data: {
msg: 'Hello world'
},
render (h) {
return h(
'div',
{ attrs: { id: 'my-id' },
[ this.msg ]
);
}
<div id='my-id'>Hello world</div>
data: {
msg: 'Hello world'
},
render (h) {
return (
<div id='my-id'>,
{ this.msg }
</div>
);
}
new Vue({
el: '#app',
data: {
msg: 'Click to see the message'
},
methods: {
hello () {
alert('This is the message')
}
}
});
<div id="app">
<span
class="my-class"
style="cursor: pointer"
v-on:click="hello"
>
{{ msg }}
</span>
</div>
new Vue({
el: '#app',
data: {
msg: 'Click to see the message'
},
methods: {
hello () {
alert('This is the message')
}
},
render (createElement) {
return createElement(
'span',
{
class: { 'my-class': true },
style: { cursor: 'pointer' },
on: {
click: this.hello
}
},
[ this.msg ]
);
},
});
<div id="app"><!--span will render here--></div>
new Vue({
el: '#app',
data: {
msg: 'Click to see the message.'
},
methods: {
hello () {
alert('This is the message.')
}
},
render: function render(h) {
return (
<span
class={{ 'my-class': true }}
style={{ cursor: 'pointer' }}
on-click={ this.hello }
>
{ this.msg }
</span>
)
}
});
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
]
{
"presets": ["es2015"],
"plugins": ["transform-vue-jsx"]
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有