Activity 4: Install PrimeVue into the Library Web Application
本页目录· 3 条
- 4.1 Open the terminal within our library web application, and run the following code:
- 4.2 Open main.js and configure PrimeVue to use a theme like Aura, as shown below (use updated version "@primevue" -> "@primeuix"):
- 4.3 The goal of this activity is to add a user record to the PrimeVue DataTable after the user submits the form, as demonstrated below:
4.1 Open the terminal within our library web application, and run the following code:
npm install primevue
npm install @primevue/themes 4.2 Open main.js and configure PrimeVue to use a theme like Aura, as shown below (use updated version "@primevue" -> "@primeuix"):
4.3 The goal of this activity is to add a user record to the PrimeVue DataTable after the user submits the form, as demonstrated below:
1) 引入组件
在表单这个 .vue 文件的 <script setup> 顶部加入:
2) 给提交记录加一个唯一 id(给 DataTable 用)
然后把 submitForm() 里成功提交的 push 改为:
3) 用 DataTable 展示数据(替换卡片区域)