client-only.js 297 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // 只在客户端进行处理的组件 export default { name: 'ClientOnly', functional: true, render(h, { parent, children }) { if (parent._isMounted) { return children; } else { parent.$once('hook:mounted', () => { parent.$forceUpdate(); }); } } };