<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          來吧,解鎖 Vue3 全家桶+Ts 的正確姿勢

          共 1293字,需瀏覽 3分鐘

           ·

          2021-10-17 06:02


          創(chuàng)建項目

          基礎語法

          定義data

          • script標簽上lang="ts"
          • 定義一個類型type或者接口interface來約束data
          • 可以使用ref或者toRefs來定義響應式數(shù)據(jù)
          • 使用refsetup讀取的時候需要獲取xxx.value,但在template中不需要
          • 使用reactive時,可以用toRefs解構導出,在template就可以直接使用了

          是不是看起來簡潔了很多,組件直接導入就行了,不用注冊組件,數(shù)據(jù)定義了就可以用。其實我們可以簡單的理解為script包括的內(nèi)容就是setup中的,并做了return。

          導出方法

          
          
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                    <th id="afajh"><progress id="afajh"></progress></th>
                    日本伊人大香蕉 | 日本色情在线视频 | 欧美操逼影视 | 青娱乐免费视频在线观看 | 天天添夜夜干 |