Vue之x-template(2)
将html结构写在一对script标签中,设置type=“x-template”
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="./vue.js"></script>
</head>
<body>
<div id="demo">
<span>miaov ketang</span>
</div>
<script type="x-template" id="temp">
<div>
hello {{abc}}
<span>miaov</span>
</div>
</script>
<script>
let obj={
html:"<div>hello,miaov</div>",
abc:
};
var vm=new Vue({
el:"#demo",
data:obj,
template:"#temp" /*将新渲染的str替换掉前面的整个div*/
//
})
</script>
</body>
</html>
.
Vue之x-template(2)的更多相关文章
- vue error:The template root requires exactly one element.
error:[vue/valid-template-root] The template root requires exactly one element. 原因: 因为vue的模版中只有能一个根节 ...
- [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
转载自:https://segmentfault.com/a/1190000006435886 解决办法:添加package.config.js配置文件中,添加本文章的红色部分代码 import vu ...
- Vue学习笔记 template methods,filters,ChromeDriver,安装sass
ChromeDriver installation failed Error with http(s) request: Error: connect ETIMEDOUT 172.217.160.80 ...
- Kendo-Grid for Vue API and Template
写此博客的原因:在做项目时前端用的vue,后端用的jfinal.在前端veu中调用了kendo grid插件,但是在官方文档中对kendo grid for vue 的api和template都不太详 ...
- [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available
原文链接https://blog.csdn.net/xiaomajia029/article/details/88320233 问题描述: 原因分析:在项目配置的时候,默认 npm 包导出的是运行时构 ...
- You are using the runtime-only build of Vue where the template compiler is not available. Either pre
在升级脚手架到vue-cli3.0版本的时候出现了这个报错: [Vue warn]: You are using the runtime-only build of Vue where the tem ...
- You are using the runtime-only build of Vue where the template compiler is not available.
使用vue-cli搭建的项目,启动报错 You are using the runtime-only build of Vue where the template compiler is not a ...
- You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
异常 You are using the runtime-only build of Vue where the template compiler is not available. Either ...
- 聊聊Vue.js的template编译
写在前面 因为对Vue.js很感兴趣,而且平时工作的技术栈也是Vue.js,这几个月花了些时间研究学习了一下Vue.js源码,并做了总结与输出. 文章的原地址:https://github.com/a ...
- Vue中的template标签的使用和在template标签上使用v-for
我们知道 .vue 文件的基本结构是: <template> ........ </template> <script> export default { nam ...
随机推荐
- linux下修改apache,nginx服务端口号
一.linux下修改apache端口号 yum安装后,apache配置文件: /etc/httpd/conf/httpd.conf 找到apache目录下的 httpd.conf, 使用vi 打开,找 ...
- 【转】Commonjs规范及Node模块实现
前言: Node在实现中并非完全按照CommonJS规范实现,而是对模块规范进行了一定的取舍,同时也增加了少许自身需要的特性.本文将详细介绍NodeJS的模块实现 引入 nodejs是区别于javas ...
- AutoIT: ControlCommand是一个非常重要的指令
ControlCommand可以确定窗口中的复选框是否选中状态,然后可以对这些复选框进行操作.可以对ComboBox和ListBox进行操作如选择下拉框的某个选项 if WinExists(" ...
- MD5加密 和Sha256加密
//MD5加密 private static string GetMd5Hash(string emailAddress) { byte[] data = MD5.Create().ComputeHa ...
- appium封装显示等待Wait类和ExpectedCondition接口
此文已由作者夏鹏授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 使用WebDriver做Web自动化的时候,org.openqa.selenium.support.ui中提供 ...
- Ceph之PG数调整
1. PG介绍 PG, Placement Groups.CRUSH先将数据分解成一组对象,然后根据对象名称.复制级别和系统中的PG数等信息执行散列操作,再将结果生成PG ID.可以将PG看做一个逻辑 ...
- postgresql数据库基本信息查看
切换至postgresql数据库用户pguser 或 postgres(根据自己实际情况) 1. SELECT version(); 2.对的 2. 查看数据库大小: SELECT pg_size ...
- bzoj 4517: [Sdoi2016]排列计数【容斥原理+组合数学】
第一个一眼就A的容斥题! 这个显然是容斥的经典问题------错排,首先考虑没有固定的情况,设\( D_n \)为\( n \)个数字的错排方案数. \[ D_n=n!-\sum_{t=1}^{n}( ...
- [App Store Connect帮助]七、在 App Store 上发行(4)分阶段发布某个版本更新(iOS 和 watchOS)
当您发布您 App 的一个版本更新时,您可以选择分阶段发布您的 iOS App.如果您正在提交一个 iOS 版本更新,且您的 App 处于以下 App 状态之一,则此选项可用. 准备提交 正在等待审核 ...
- Luogu P1186 玛丽卡 【最短路】By cellur925
题目描述 麦克找了个新女朋友,玛丽卡对他非常恼火并伺机报复. 因为她和他们不住在同一个城市,因此她开始准备她的长途旅行. 在这个国家中每两个城市之间最多只有一条路相通,并且我们知道从一个城市到另一个城 ...