AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
### 定义rootpath变量 ``` var rootPath="http://xxx.com" ``` ### 获取head标签 ``` var head= document.getElementsByTagName('head')[0]; ``` ### 定义script标签 ``` var script= document.createElement('script'); script.type = "text/javascript"; script.src= rootPath +'js/vue/vue.js'; ``` ### 添加进head ``` head.appendChild(script); ``` ### script加载后执行,定义vue对象 ``` script.onload = function(){ var app = new Vue({ el: '#app', data: { aa:1 }, methods:{ setData(data){ this.data = data } } }) }; ``` ### 使用vue双向绑定 ``` <div>{{aa}}</div> ```