打包0.6.3
This commit is contained in:
parent
bdb6078df6
commit
060a448cd5
File diff suppressed because one or more lines are too long
@ -37,7 +37,7 @@ node.nodeData.data
|
|||||||
<h1>我是自定义节点</h1>
|
<h1>我是自定义节点</h1>
|
||||||
${ node.nodeData.text }
|
${ node.nodeData.text }
|
||||||
`
|
`
|
||||||
return dev
|
return div
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -96,3 +96,19 @@ import i18n from './i18n'
|
|||||||
|
|
||||||
## 示例3:渲染Vue3组件
|
## 示例3:渲染Vue3组件
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { createApp } from "vue"
|
||||||
|
import CustomNodeContent from './CustomNodeContent.vue'
|
||||||
|
|
||||||
|
{
|
||||||
|
customCreateNodeContent: (node) => {
|
||||||
|
let el = document.createElement('div')
|
||||||
|
const app = createApp(CustomNodeContent, {// props
|
||||||
|
html: node.nodeData.data.text
|
||||||
|
})
|
||||||
|
app.mount(el)
|
||||||
|
return el
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
<h1>我是自定义节点</h1>
|
<h1>我是自定义节点</h1>
|
||||||
<span class="hljs-subst">${ node.nodeData.text }</span>
|
<span class="hljs-subst">${ node.nodeData.text }</span>
|
||||||
`</span>
|
`</span>
|
||||||
<span class="hljs-keyword">return</span> dev
|
<span class="hljs-keyword">return</span> div
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
@ -78,6 +78,20 @@
|
|||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2>示例3:渲染Vue3组件</h2>
|
<h2>示例3:渲染Vue3组件</h2>
|
||||||
|
<pre class="hljs"><code><span class="hljs-keyword">import</span> { createApp } <span class="hljs-keyword">from</span> <span class="hljs-string">"vue"</span>
|
||||||
|
<span class="hljs-keyword">import</span> CustomNodeContent <span class="hljs-keyword">from</span> <span class="hljs-string">'./CustomNodeContent.vue'</span>
|
||||||
|
|
||||||
|
{
|
||||||
|
<span class="hljs-attr">customCreateNodeContent</span>: <span class="hljs-function">(<span class="hljs-params">node</span>) =></span> {
|
||||||
|
<span class="hljs-keyword">let</span> el = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'div'</span>)
|
||||||
|
<span class="hljs-keyword">const</span> app = createApp(CustomNodeContent, {<span class="hljs-comment">// props</span>
|
||||||
|
<span class="hljs-attr">html</span>: node.nodeData.data.text
|
||||||
|
})
|
||||||
|
app.mount(el)
|
||||||
|
<span class="hljs-keyword">return</span> el
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -300,7 +300,7 @@ export default {
|
|||||||
...(config || {}),
|
...(config || {}),
|
||||||
iconList: icon,
|
iconList: icon,
|
||||||
useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag,
|
useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag,
|
||||||
isUseCustomNodeContent: false,
|
// isUseCustomNodeContent: true,
|
||||||
// 示例1:组件里用到了router、store、i18n等实例化vue组件时需要用到的东西
|
// 示例1:组件里用到了router、store、i18n等实例化vue组件时需要用到的东西
|
||||||
// customCreateNodeContent: (node) => {
|
// customCreateNodeContent: (node) => {
|
||||||
// let el = document.createElement('div')
|
// let el = document.createElement('div')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user