上善若水

水善利万物而不争
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

温故知新 常看常联系 如下网站资料 VUE

Posted on 2022-03-23 10:29  董锡振  阅读(34)  评论(0编辑  收藏  举报

 

温故知新 常看常联系 如下网站资料:

1.https://cn.vuejs.org/v2/guide/

2.https://www.runoob.com/vue2/vue-tutorial.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="namesCtrl">
<p>循环对象:</p>
<ul>
<li ng-repeat="x in names | orderBy:'name'|filter:test">
{{ (x.name | uppercase) + ', ' + x.country }}
</li>
</ul>
<input type="number" ng-model="x" ng-init="x=2">
<input type="number" ng-model="y" ng-init="y=3">
<p>总价 = {{ (x * y) | currency }}</p>
<p><input type="text" ng-model="test"></p>
姓名: {{ msg | reverse }}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('namesCtrl', function($scope) {
$scope.names = [
{name:'Jani',country:'Norway'},
{name:'Hege',country:'Sweden'},
{name:'Kai',country:'Denmark'}
];
$scope.msg = "Runoob";
});
app.filter('reverse', function() { //可以注入依赖
return function(text) {
return text.split("").reverse().join("");
}
});
</script>
</body>
</html>