1 Star 0 Fork 0

王晨曦/lrean-vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
013.html 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
wangchenxi 提交于 2022-05-06 22:32 . 013
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.min.js"></script>
</head>
<body>
<h3>013.html</h3>
<div id="app">
<div v-for="item in list">
{{item.id}} -- {{item.name}} -- {{item.birthday}} -- {{item.birthday | foo}}
</div>
</div>
<div id="app2">
{{msg | foo}}
</div>
<script>
let app = new Vue({
el: "#app",
data: {
list:[
{id:1, name:"关羽", birthday:"2011-11-11"},
{id:2, name:"张飞", birthday:"2001-11-11"},
{id:3, name:"赵云", birthday:"2015-12-11"},
{id:4, name:"马超", birthday:"2013-1-11"},
{id:5, name:"黄忠", birthday:"2014-11-1"},
]
},
methods: {
},
filters: {
foo(val) {
let dd = new Date(val);
console.log(dd);
return dd.getFullYear() + "/" + (dd.getMonth()+1) + "/" + dd.getDate() + "~~~";
}
}
});
let app2 = new Vue({
el: "#app2",
data: {
msg:"2008-8-8"
}
});
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chen-xi-wang666/lrean-vue.git
git@gitee.com:chen-xi-wang666/lrean-vue.git
chen-xi-wang666
lrean-vue
lrean-vue
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385