基于Vue3.0發(fā)布在GitHub上的第一版源碼(2019.10.05)整理

預(yù)備知識
先把Vue3.0跑起來
先把vue-next倉庫的代碼clone下來,安裝依賴然后構(gòu)建一下,vue的package下的dist目錄下找到構(gòu)建的腳本,引入腳本即可。
下面一個簡單計數(shù)器的DEMO:
<!DOCTYPE html>
<html lang="en">
<body>
<div id='app'></div>
</body>
<script src="./dist/vue.global.js"></script>
<script>
const { createApp, reactive, computed } = Vue;
const RootComponent = {
template: `
<button @click="increment">
Count is: {{ state.count }}
</button>
`,
setup() {
const state = reactive({
count: 0,
})
function increment() {
state.count++
}
return {
state,
increment
}
}
}
createApp().mount(RootComponent, '#app')
</script>
</html>
網(wǎng)頁題目:Vue3.0數(shù)據(jù)響應(yīng)式原理詳解-創(chuàng)新互聯(lián)
轉(zhuǎn)載注明:http://chinadenli.net/article12/cddgdc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站改版、App開發(fā)、商城網(wǎng)站、Google、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容