JavaScript/vue.js/render:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“== 引言 == <syntaxhighlight lang="javascript"> import Vue from 'vue'; import App from '../../view/common/ss.vue';</syntaxhighlight> <syntaxhighlight lang="javascri…”
 
Kangkk​(留言 | 贡献)
无编辑摘要
 
第1行: 第1行:
== 引言 ==
== 引言 ==
render 写法的几种转化形式
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
import Vue from 'vue';
import Vue from 'vue';

2020年7月2日 (四) 03:46的最新版本

引言

render 写法的几种转化形式

import Vue from 'vue';
import App from '../../view/common/ss.vue';
new Vue(App).$mount('#indexPage');

new Vue({render: function (createElement) {
    return createElement(App);
}}).$mount('#indexPage');

new Vue({render (createElement) {
    return createElement(App);
}}).$mount('#indexPage');

new Vue({render (h) {
    return h(App);
}}).$mount('#indexPage');

new Vue({h => h(App)}).$mount('#indexPage');
import App from './App'
new Vue({
    el: '#root',
    template: '<App></App>',
    components: {
        App
    }
})