主頁 > 企業開發 > Vue3從入門到精通(三)

Vue3從入門到精通(三)

2023-06-30 09:07:11 企業開發

vue3插槽Slots

在 Vue3 中,插槽(Slots)的使用方式與 Vue2 中基本相同,但有一些細微的差異,以下是在 Vue3 中使用插槽的示例:

// ChildComponent.vue
<template>
  <div>
    <h2>Child Component</h2>
    <slot></slot>
  </div>
</template>
?
// ParentComponent.vue
<template>
  <div>
    <h1>Parent Component</h1>
    <ChildComponent>
      <p>This is the content of the slot.</p>
    </ChildComponent>
  </div>
</template>
?
<script>
  import { defineComponent } from 'vue'
  import ChildComponent from './ChildComponent.vue'
?
  export default defineComponent({
    name: 'ParentComponent',
    components: {
      ChildComponent
    }
  })
</script>

在上面的示例中,ChildComponent 組件定義了一個默認插槽,使用 <slot></slot> 標簽來表示插槽的位置,在 ParentComponent 組件中,使用 <ChildComponent> 標簽包裹了一段內容 <p>This is the content of the slot.</p>,這段內容將被插入到 ChildComponent 組件的插槽位置,

需要注意的是,在 Vue3 中,默認插槽不再具有具名插槽的概念,如果需要使用具名插槽,可以使用 v-slot 指令,以下是一個示例:

// ChildComponent.vue
<template>
  <div>
    <h2>Child Component</h2>
    <slot name="header"></slot>
    <slot></slot>
    <slot name="footer"></slot>
  </div>
</template>
?
// ParentComponent.vue
<template>
  <div>
    <h1>Parent Component</h1>
    <ChildComponent>
      <template v-slot:header>
        <h3>This is the header slot</h3>
      </template>
      <p>This is the content of the default slot.</p>
      <template v-slot:footer>
        <p>This is the footer slot</p>
      </template>
    </ChildComponent>
  </div>
</template>
?
<script>
  import { defineComponent } from 'vue'
  import ChildComponent from './ChildComponent.vue'
?
  export default defineComponent({
    name: 'ParentComponent',
    components: {
      ChildComponent
    }
  })
</script>

在上面的示例中,ChildComponent 組件定義了三個插槽,分別是名為 header、默認插槽和名為 footer 的插槽,在 ParentComponent 組件中,使用 <template v-slot:header> 來定義 header 插槽的內容,使用 <template v-slot:footer> 來定義 footer 插槽的內容,默認插槽可以直接寫在組件標簽內部,

需要注意的是,在 Vue3 中,v-slot 只能用在 <template> 標簽上,不能用在普通的 HTML 標簽上,如果要在普通 HTML 標簽上使用插槽,可以使用 v-slot 的縮寫語法 #,例如,<template v-slot:header> 可以簡寫為 #header

vue3組件生命周期

在 Vue3 中,組件的生命周期鉤子函式與 Vue2 中有一些變化,以下是 Vue3 中常用的組件生命周期鉤子函式:

  1. beforeCreate: 在實體初始化之后、資料觀測之前被呼叫,

  2. created: 在實體創建完成之后被呼叫,此時,實體已完成資料觀測、屬性和方法的運算,但尚未掛載到 DOM 中,

  3. beforeMount: 在掛載開始之前被呼叫,在此階段,模板已經編譯完成,但尚未將模板渲染到 DOM 中,

  4. mounted: 在掛載完成之后被呼叫,此時,組件已經被掛載到 DOM 中,可以訪問到 DOM 元素,

  5. beforeUpdate: 在資料更新之前被呼叫,在此階段,虛擬 DOM 已經重新渲染,并將計算得到的變化應用到真實 DOM 上,但尚未更新到視圖中,

  6. updated: 在資料更新之后被呼叫,此時,組件已經更新到最新的狀態,DOM 也已經更新完成,

  7. beforeUnmount: 在組件卸載之前被呼叫,在此階段,組件實體仍然可用,可以訪問到組件的資料和方法,

  8. unmounted: 在組件卸載之后被呼叫,此時,組件實體已經被銷毀,無法再訪問到組件的資料和方法,

需要注意的是,Vue3 中移除了一些生命周期鉤子函式,如 beforeDestroydestroyed,取而代之的是 beforeUnmountunmounted

另外,Vue3 中還引入了新的生命周期鉤子函式 onRenderTrackedonRenderTriggered,用于追蹤組件的渲染程序和觸發的依賴項,

需要注意的是,Vue3 推薦使用 Composition API 來撰寫組件邏輯,而不是依賴于生命周期鉤子函式,Composition API 提供了 setup 函式,用于組件的初始化和邏輯組織,在 setup 函式中,可以使用 onBeforeMountonMountedonBeforeUpdateonUpdatedonBeforeUnmount 等函式來替代相應的生命周期鉤子函式,

vue3生命周期應用

Vue3 的生命周期鉤子函式可以用于在組件的不同生命周期階段執行相應的操作,以下是一些 Vue3 生命周期的應用場景示例:

  1. beforeCreatecreated:在組件實體創建之前和創建之后執行一些初始化操作,如設定初始資料、進行異步請求等,

export default {
  beforeCreate() {
    console.log('beforeCreate hook');
    // 執行一些初始化操作
  },
  created() {
    console.log('created hook');
    // 執行一些初始化操作
  },
};
  1. beforeMountmounted:在組件掛載之前和掛載之后執行一些 DOM 操作,如獲取 DOM 元素、系結事件等,

export default {
  beforeMount() {
    console.log('beforeMount hook');
    // 執行一些 DOM 操作
  },
  mounted() {
    console.log('mounted hook');
    // 執行一些 DOM 操作
  },
};
  1. beforeUpdateupdated:在組件資料更新之前和更新之后執行一些操作,如更新 DOM、發送請求等,

export default {
  beforeUpdate() {
    console.log('beforeUpdate hook');
    // 執行一些操作
  },
  updated() {
    console.log('updated hook');
    // 執行一些操作
  },
};
  1. beforeUnmountunmounted:在組件卸載之前和卸載之后執行一些清理操作,如取消訂閱、清除定時器等,

export default {
  beforeUnmount() {
    console.log('beforeUnmount hook');
    // 執行一些清理操作
  },
  unmounted() {
    console.log('unmounted hook');
    // 執行一些清理操作
  },
};

這些示例展示了 Vue3 生命周期鉤子函式的一些常見應用場景,根據具體需求,你可以在相應的生命周期鉤子函式中執行適當的操作,

vue3動態組件

在 Vue3 中,可以使用動態組件來根據不同的條件或狀態動態地渲染不同的組件,使用動態組件可以使應用更加靈活和可擴展,以下是使用動態組件的示例:

  1. 使用 component 元素和 :is 屬性來實作動態組件的渲染:

<template>
  <div>
    <component :is="currentComponent"></component>
    <button @click="toggleComponent">Toggle Component</button>
  </div>
</template>
?
<script>
import ComponentA from './ComponentA.vue';
import ComponentB from './ComponentB.vue';
?
export default {
  data() {
    return {
      currentComponent: 'ComponentA',
    };
  },
  methods: {
    toggleComponent() {
      this.currentComponent = this.currentComponent === 'ComponentA' ? 'ComponentB' : 'ComponentA';
    },
  },
  components: {
    ComponentA,
    ComponentB,
  },
};
</script>

在上面的示例中,根據 currentComponent 的值動態地渲染 ComponentAComponentB 組件,點擊按鈕時,切換 currentComponent 的值,從而實作動態組件的切換,

  1. 使用 v-ifv-else 來根據條件渲染不同的組件:

<template>
  <div>
    <component-a v-if="showComponentA"></component-a>
    <component-b v-else></component-b>
    <button @click="toggleComponent">Toggle Component</button>
  </div>
</template>
?
<script>
import ComponentA from './ComponentA.vue';
import ComponentB from './ComponentB.vue';
?
export default {
  data() {
    return {
      showComponentA: true,
    };
  },
  methods: {
    toggleComponent() {
      this.showComponentA = !this.showComponentA;
    },
  },
  components: {
    ComponentA,
    ComponentB,
  },
};
</script>

在上面的示例中,根據 showComponentA 的值使用 v-ifv-else 來渲染 ComponentAComponentB 組件,點擊按鈕時,切換 showComponentA 的值,從而實作動態組件的切換,

這些示例演示了在 Vue3 中如何使用動態組件來根據條件或狀態動態地渲染不同的組件,你可以根據具體需求選擇適合的方式來使用動態組件,

vue3組件保持存活

在 Vue3 中,可以使用 <keep-alive> 組件來保持組件的存活狀態,即使組件在組件樹中被切換或銷毀,它的狀態仍然會被保留,這對于需要在組件之間共享狀態或快取資料的場景非常有用,以下是使用 <keep-alive> 組件來保持組件存活的示例:

<template>
  <div>
    <button @click="toggleComponent">Toggle Component</button>
    <keep-alive>
      <component :is="currentComponent"></component>
    </keep-alive>
  </div>
</template>
?
<script>
import ComponentA from './ComponentA.vue';
import ComponentB from './ComponentB.vue';
?
export default {
  data() {
    return {
      currentComponent: 'ComponentA',
    };
  },
  methods: {
    toggleComponent() {
      this.currentComponent = this.currentComponent === 'ComponentA' ? 'ComponentB' : 'ComponentA';
    },
  },
  components: {
    ComponentA,
    ComponentB,
  },
};
</script>

在上面的示例中,使用 <keep-alive> 組件將 <component> 包裹起來,這樣在切換組件時,被包裹的組件的狀態將會被保留,點擊按鈕時,切換 currentComponent 的值,從而切換要渲染的組件,

需要注意的是,被 <keep-alive> 包裹的組件在切換時會觸發一些特定的生命周期鉤子函式,如 activateddeactivated,你可以在這些鉤子函式中執行一些特定的操作,如獲取焦點、發送請求等,

<template>
  <div>
    <h2>Component A</h2>
  </div>
</template>
?
<script>
export default {
  activated() {
    console.log('Component A activated');
    // 執行一些操作
  },
  deactivated() {
    console.log('Component A deactivated');
    // 執行一些操作
  },
};
</script>

在上面的示例中,當組件 A 被激活或停用時,分別在 activateddeactivated 鉤子函式中輸出相應的資訊,

使用 <keep-alive> 組件可以方便地保持組件的存活狀態,并在組件之間共享狀態或快取資料,

vue3異步組件

在 Vue3 中,可以使用異步組件來延遲加載組件的代碼,從而提高應用的性能和加載速度,異步組件在需要時才會被加載,而不是在應用初始化時就加載所有組件的代碼,以下是使用異步組件的示例:

  1. 使用 defineAsyncComponent 函式來定義異步組件:

<template>
  <div>
    <button @click="loadComponent">Load Component</button>
    <component v-if="isComponentLoaded" :is="component"></component>
  </div>
</template>
?
<script>
import { defineAsyncComponent } from 'vue';
?
const AsyncComponent = defineAsyncComponent(() =>
  import('./Component.vue')
);
?
export default {
  data() {
    return {
      isComponentLoaded: false,
      component: null,
    };
  },
  methods: {
    loadComponent() {
      this.isComponentLoaded = true;
      this.component = AsyncComponent;
    },
  },
};
</script>

在上面的示例中,使用 defineAsyncComponent 函式來定義異步組件 AsyncComponent,當點擊按鈕時,設定 isComponentLoadedtrue,并將 component 設定為 AsyncComponent,從而加載異步組件,

  1. 使用 Suspense 組件來處理異步組件的加載狀態:

<template>
  <div>
    <Suspense>
      <template #default>
        <component :is="component"></component>
      </template>
      <template #fallback>
        <div>Loading...</div>
      </template>
    </Suspense>
    <button @click="loadComponent">Load Component</button>
  </div>
</template>
?
<script>
import { defineAsyncComponent, Suspense } from 'vue';
?
const AsyncComponent = defineAsyncComponent(() =>
  import('./Component.vue')
);
?
export default {
  data() {
    return {
      component: null,
    };
  },
  methods: {
    loadComponent() {
      this.component = AsyncComponent;
    },
  },
};
</script>

在上面的示例中,使用 Suspense 組件來處理異步組件的加載狀態,在 default 插槽中,渲染異步組件,而在 fallback 插槽中,渲染加載狀態的提示資訊,當點擊按鈕時,加載異步組件,

這些示例演示了在 Vue3 中如何使用異步組件來延遲加載組件的代碼,使用異步組件可以提高應用的性能和加載速度,特別是在應用中有大量組件時,

vue3依賴注入

在 Vue3 中,可以使用依賴注入來在組件之間共享資料或功能,Vue3 提供了 provideinject 兩個函式來實作依賴注入,

  1. 使用 provide 函式在父組件中提供資料或功能:

<template>
  <div>
    <ChildComponent></ChildComponent>
  </div>
</template>
?
<script>
import { provide } from 'vue';
import MyService from './MyService';
?
export default {
  setup() {
    provide('myService', new MyService());
  },
};
</script>

在上面的示例中,使用 provide 函式在父組件中提供了一個名為 myService 的資料或功能,它的值是一個 MyService 的實體,

  1. 使用 inject 函式在子組件中注入提供的資料或功能:

<template>
  <div>
    <p>{{ message }}</p>
  </div>
</template>
?
<script>
import { inject } from 'vue';
?
export default {
  setup() {
    const myService = inject('myService');
    const message = myService.getMessage();
?
    return {
      message,
    };
  },
};
</script>

在上面的示例中,使用 inject 函式在子組件中注入了父組件提供的名為 myService 的資料或功能,通過注入的 myService 實體,可以呼叫其中的方法或訪問其中的屬性,

通過使用 provideinject 函式,可以在組件之間實作依賴注入,從而實作資料或功能的共享,這在多個組件需要訪問相同的資料或功能時非常有用,

vue3應用

Vue3 是一個用于構建用戶界面的現代化 JavaScript 框架,它具有回應式資料系結、組件化、虛擬 DOM 等特性,使得開發者可以更高效地構建互動式的 Web 應用,

下面是一些使用 Vue3 開發應用的步驟:

  1. 安裝 Vue3:使用 npm 或 yarn 安裝 Vue3 的最新版本,

npm install vue@next
  1. 創建 Vue3 應用:創建一個新的 Vue3 專案,

vue create my-app
  1. 撰寫組件:在 src 目錄下創建組件檔案,例如 HelloWorld.vue

<template>
  <div>
    <h1>{{ message }}</h1>
    <button @click="changeMessage">Change Message</button>
  </div>
</template>
?
<script>
import { ref } from 'vue';
?
export default {
  setup() {
    const message = ref('Hello, Vue3!');
?
    const changeMessage = () => {
      message.value = 'https://www.cnblogs.com/for-easy-fast/archive/2023/06/30/Hello, World!';
    };
?
    return {
      message,
      changeMessage,
    };
  },
};
</script>

在上面的示例中,使用 ref 函式創建了一個回應式的資料 message,并在模板中使用它,通過點擊按鈕,可以改變 message 的值,

  1. 使用組件:在 App.vue 中使用自定義的組件,

<template>
  <div>
    <HelloWorld></HelloWorld>
  </div>
</template>
?
<script>
import HelloWorld from './components/HelloWorld.vue';
?
export default {
  components: {
    HelloWorld,
  },
};
</script>

在上面的示例中,匯入并注冊了自定義的 HelloWorld 組件,并在模板中使用它,

  1. 運行應用:在命令列中運行以下命令啟動應用,

npm run serve

這將啟動開發服務器,并在瀏覽器中打開應用,

這只是一個簡單的示例,你可以根據實際需求撰寫更復雜的組件和應用邏輯,Vue3 還提供了許多其他功能和工具,如路由、狀態管理、單檔案組件等,以幫助你構建更強大的應用,

希望這個簡單的示例能幫助你入門 Vue3 應用的開發!

付費內容,請聯系本人QQ:1002453261

本文來自博客園,作者:明志德道,轉載請注明原文鏈接:https://www.cnblogs.com/for-easy-fast/p/17515670.html

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/556385.html

標籤:其他

上一篇:記錄--寫一個高德地圖巡航功能的小DEMO

下一篇:返回列表

標籤雲
其他(161906) Python(38266) JavaScript(25517) Java(18286) C(15238) 區塊鏈(8274) C#(7972) AI(7469) 爪哇(7425) MySQL(7278) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5876) 数组(5741) R(5409) Linux(5347) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4609) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2438) ASP.NET(2404) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) .NET技术(1985) HtmlCss(1979) 功能(1967) Web開發(1951) C++(1942) python-3.x(1918) 弹簧靴(1913) xml(1889) PostgreSQL(1881) .NETCore(1863) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • IEEE1588PTP在數字化變電站時鐘同步方面的應用

    IEEE1588ptp在數字化變電站時鐘同步方面的應用 京準電子科技官微——ahjzsz 一、電力系統時間同步基本概況 隨著對IEC 61850標準研究的不斷深入,國內外學者提出基于IEC61850通信標準體系建設數字化變電站的發展思路。數字化變電站與常規變電站的顯著區別在于程序層傳統的電流/電壓互 ......

    uj5u.com 2020-09-10 03:51:52 more
  • HTTP request smuggling CL.TE

    CL.TE 簡介 前端通過Content-Length處理請求,通過反向代理或者負載均衡將請求轉發到后端,后端Transfer-Encoding優先級較高,以TE處理請求造成安全問題。 檢測 發送如下資料包 POST / HTTP/1.1 Host: ac391f7e1e9af821806e890 ......

    uj5u.com 2020-09-10 03:52:11 more
  • 網路滲透資料大全單——漏洞庫篇

    網路滲透資料大全單——漏洞庫篇漏洞庫 NVD ——美國國家漏洞庫 →http://nvd.nist.gov/。 CERT ——美國國家應急回應中心 →https://www.us-cert.gov/ OSVDB ——開源漏洞庫 →http://osvdb.org Bugtraq ——賽門鐵克 →ht ......

    uj5u.com 2020-09-10 03:52:15 more
  • 京準講述NTP時鐘服務器應用及原理

    京準講述NTP時鐘服務器應用及原理京準講述NTP時鐘服務器應用及原理 安徽京準電子科技官微——ahjzsz 北斗授時原理 授時是指接識訓通過某種方式獲得本地時間與北斗標準時間的鐘差,然后調整本地時鐘使時差控制在一定的精度范圍內。 衛星導航系統通常由三部分組成:導航授時衛星、地面檢測校正維護系統和用戶 ......

    uj5u.com 2020-09-10 03:52:25 more
  • 利用北斗衛星系統設計NTP網路時間服務器

    利用北斗衛星系統設計NTP網路時間服務器 利用北斗衛星系統設計NTP網路時間服務器 安徽京準電子科技官微——ahjzsz 概述 NTP網路時間服務器是一款支持NTP和SNTP網路時間同步協議,高精度、大容量、高品質的高科技時鐘產品。 NTP網路時間服務器設備采用冗余架構設計,高精度時鐘直接來源于北斗 ......

    uj5u.com 2020-09-10 03:52:35 more
  • 詳細解讀電力系統各種對時方式

    詳細解讀電力系統各種對時方式 詳細解讀電力系統各種對時方式 安徽京準電子科技官微——ahjzsz,更多資料請添加VX 衛星同步時鐘是我京準公司開發研制的應用衛星授時時技術的標準時間顯示和發送的裝置,該裝置以M國全球定位系統(GLOBAL POSITIONING SYSTEM,縮寫為GPS)或者我國北 ......

    uj5u.com 2020-09-10 03:52:45 more
  • 如何保證外包團隊接入企業內網安全

    不管企業規模的大小,只要企業想省錢,那么企業的某些服務就一定會采用外包的形式,然而看似美好又經濟的策略,其實也有不好的一面。下面我通過安全的角度來聊聊使用外包團的安全隱患問題。 先看看什么服務會使用外包的,最常見的就是話務/客服這種需要大量重復性、無技術性的服務,或者是一些銷售外包、特殊的職能外包等 ......

    uj5u.com 2020-09-10 03:52:57 more
  • PHP漏洞之【整型數字型SQL注入】

    0x01 什么是SQL注入 SQL是一種注入攻擊,通過前端帶入后端資料庫進行惡意的SQL陳述句查詢。 0x02 SQL整型注入原理 SQL注入一般發生在動態網站URL地址里,當然也會發生在其它地發,如登錄框等等也會存在注入,只要是和資料庫打交道的地方都有可能存在。 如這里http://192.168. ......

    uj5u.com 2020-09-10 03:55:40 more
  • [GXYCTF2019]禁止套娃

    git泄露獲取原始碼 使用GET傳參,引數為exp 經過三層過濾執行 第一層過濾偽協議,第二層過濾帶引數的函式,第三層過濾一些函式 preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp'] (?R)參考當前正則運算式,相當于匹配函式里的引數 因此傳遞 ......

    uj5u.com 2020-09-10 03:56:07 more
  • 等保2.0實施流程

    流程 結論 ......

    uj5u.com 2020-09-10 03:56:16 more
最新发布
  • Vue3從入門到精通(三)

    vue3插槽Slots 在 Vue3 中,插槽(Slots)的使用方式與 Vue2 中基本相同,但有一些細微的差異。以下是在 Vue3 中使用插槽的示例: // ChildComponent.vue <template> <div> <h2>Child Component</h2> <slot></ ......

    uj5u.com 2023-06-30 09:07:11 more
  • 記錄--寫一個高德地圖巡航功能的小DEMO

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 風格設定 加載地圖 使用AMapLoader.load加載地圖,從 控制臺 申請一個屬于自己的key import AMapLoader from '@amap/amap-jsapi-loader'; ... const AMap = a ......

    uj5u.com 2023-06-30 08:29:46 more
  • CSS基礎-背景

    # 背景 ### **background-color** 背景顏色, 可以使用十六進制、rgb、rgba表示。 **語法** ```css /**selector 背景元素的原則去*/ /** color 背景顏色的值, 可以是 顏色名稱、十六進制值、RGB、RGBA*/ selector { b ......

    uj5u.com 2023-06-30 08:29:30 more
  • 京東到家小程式-在性能及多端能力的探索實踐

    為了提高研發效率,經過技術選型采用了taro3+原生混合開發模式,本文主要講解我們是如何基于taro框架,進行多端能力的探索和性能優化。 ......

    uj5u.com 2023-06-30 08:29:18 more
  • 初入前端-HTML

    ## HTML ### HTML歷史 HTML(Hypertext Markup Language)的歷史可以追溯到上世紀90年代初,以下是HTML的主要歷史階段: 1. HTML 1.0:在1991年發布,是HTML的最初版本,用于創建基本的文本和鏈接結構,但功能有限。 2. HTML 2.0:于 ......

    uj5u.com 2023-06-30 08:29:14 more
  • 圖書商城專案練習②后端服務Node/Express/Sqlite

    本系列文章是為學習Vue的專案練習筆記,盡量詳細記錄一下一個完整專案的開發程序。面向初學者,本人也是初學者,搬磚技識訓不成熟。專案在技術上前端為主,包含一些后端代碼,從基礎的資料庫(Sqlite)、到后端服務Node.js(Express),再到Web端的Vue,包含服務端、管理后臺、商城網站、小程... ......

    uj5u.com 2023-06-30 08:28:53 more
  • XHbuilder 需要的 ipa 簽名,超詳細的教程,你不看吃虧的是自己!

    今天使用 hbuilder 運行到 ios 真機的時候,突然發現還需要 ipa 簽名,這是什么東東呢? 1、IPA 簽名是什么? 因蘋果公司禁止企業證書用于非企業內部開發者。所以開發者無法再使用DCloud的企業證書簽名的標準運行基座。 運行標準基座到iOS真機設備前,需要使用開發者的證書對基座簽名 ......

    uj5u.com 2023-06-30 08:28:36 more
  • 圖書商城專案練習①管理后臺Vue2/ElementUI

    本系列文章是為學習Vue的專案練習筆記,盡量詳細記錄一下一個完整專案的開發程序。面向初學者,本人也是初學者,搬磚技識訓不成熟。專案在技術上前端為主,包含一些后端代碼,從基礎的資料庫(Sqlite)、到后端服務Node.js(Express),再到Web端的Vue,包含服務端、管理后臺、商城網站、小程... ......

    uj5u.com 2023-06-30 08:22:43 more
  • typescript的必要性及使用

    作為一個前端語言,Javascript從最初只是用來寫頁面,到如今的移動終端、后端服務、神經網路等等,它變得幾乎無處不在。如此廣闊的應用領域,對語言的安全性、健壯性以及可維護性都有了更高的要求。盡管ECMAScript標準在近幾年有了長足的進步,但是在型別檢查方面依然毫無建樹。在這種情況下TypeS... ......

    uj5u.com 2023-06-30 08:22:16 more
  • Vue Router 原始碼分析

    最終成果,實作了一個可運行的核心路由工程:柏成/vue-router3.x。地址如下:https://gitee.com/lbcjs/vue-router3.x ......

    uj5u.com 2023-06-30 08:22:12 more