• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

vue-编写简单的提出函数


Recommended Posts

脚本src=' https://cdn。bootcdn。net/Ajax/libs/vue/2。6 .9/vue。js '/脚本

div id='应用程序'

示例:tags='['h1 ',' h2 ',' H3 ']'/示例

/div

脚本

Vue.component('示例',{

props: ['标签'],

render:函数(h) {

//const children=this。标签。map((tag,i)=h(tag,I));

//返回h('div ',儿童);

return h('div ',{ attrs: { id: 'hello' } },this.tags.map((tag,i)=h(tag,I))

);

},

});

新vue({ El : ' # app ' });

/脚本

脚本src=' https://cdn。bootcdn。net/Ajax/libs/vue/2。6 .9/vue。js '/脚本

div id='应用程序'

示例: ok=' ok '/示例

button @click='ok=!"确定"开关/按钮

/div

脚本

const Foo={

render: (h)=h('div ',' foo '),

};

常量栏={

render: (h)=h('div ',' bar '),

};

Vue.component('示例',{

props: ['ok'],

render:函数(h) {

把这个还回去。好吗?h(Foo):h(Bar);

},

});

new Vue({ el: '#app ',data : { ok : true } });

/脚本

Link to comment
Share on other sites