html>
<
htmllang="en">
<
head>
<
metacharset="utf-8">
<
title>title
title>
<
scriptsrc="vue2.513.js ">
script>
<
scriptsrc="vue-router2.0.js">
script>
head>
<
body>
<
divid=>
<
router-linkto="/login">登入
router-link>
<
router-linkto="/register/itcast">註冊
router-link>
<
router-view>
router-view>
div>
body>
<
script>
準備三個元件
var=vue.extend({});
varlogin=vue.extend();
varregister=vue.extend(
},//使用生命週期函式
created:function()
});例項化路由規則物件
varrouter=newvuerouter( ,//這個是設定預設路由
, //這樣路由物件就定義好了
] });
//開啟路由物件
newvue(
}});
script>
html>
angular js一 watch監控屬性和物件
watch 監聽乙個model,當乙個model每次改變時,都會觸發第二個函式 watch watchfn watchaction,deepwatch watchfn 帶有angular 表示式或者函式的字串,它會返回被監控的資料模型的當前值。watchaction 乙個函式function new...
Reids基礎事務以及watch監控事務和回滾
redis也是有事務的 redis執行事務的三個過程 1.開啟事務 multi 2.命令進入佇列 3.執行事務 exec如果要求在乙個連線中,在spring會使用sessioncallback介面來處理。這是為了減少效能損耗 redis的基礎事務 multi開啟事務,直到exec執行事務,期間的命令...
vue中watch陣列或者物件
1 普通的watch data watch 2 陣列的watch data watch deep true 3 物件的watch data watch deep true tips 只要bet中的屬性發生變化 可被監測到的 便會執行handler函式 如果想監測具體的屬性變化,如pokerhisto...