document.getElementById('myId').appendChild(myNewNode);
<ul id='myId'> <li>Item 1</li> <li>Item 2</li> <ul>
// Pseudo-code of a DOM node represented as Javascript
Let domNode = {
tag: 'ul'
attributes: { id: 'myId' }
children: [
// where the LI's would go
]
};
// This might be how we update the virtual DOM
domNode.children.push('<ul>Item 3</ul>');
// This function would call the DOM API and make changes // to the "real" DOM. It would do it in batches and with // more efficiency than it would with arbitrary updates. sync(originalDomNode, domNode);
new Vue({
el: '#app',
data: {
message: 'hello world'
},
render() {
var node = this.$createElement;
return node(
'div',
{ attrs: { id: 'myId' } },
this.message
);
}
});
<div id='app'> <div id='myId'>hello world</div> </div>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有