|
|
|
@ -1,19 +1,34 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { ref , computed} from 'vue'
|
|
|
|
|
|
|
|
|
|
// 导入store,并获取store
|
|
|
|
|
import { useTestStore } from '@/store/test'
|
|
|
|
|
const store = useTestStore()
|
|
|
|
|
|
|
|
|
|
// 改变store里面count的值
|
|
|
|
|
const addBtn =() =>{
|
|
|
|
|
// 方法1
|
|
|
|
|
store.count++
|
|
|
|
|
|
|
|
|
|
// 方法2
|
|
|
|
|
// store.setCount(++store.count)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通过computed取值
|
|
|
|
|
const count = computed(()=>{
|
|
|
|
|
return store.count
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<h1>测试路由搭载是否成功,不需要msg</h1>
|
|
|
|
|
<h1>测试Element-plus是否引入成功</h1>
|
|
|
|
|
<div class="mb-4">
|
|
|
|
|
<el-button>Default</el-button>
|
|
|
|
|
<el-button type="primary">Primary</el-button>
|
|
|
|
|
<el-button type="success">Success</el-button>
|
|
|
|
|
<el-button type="info">Info</el-button>
|
|
|
|
|
<el-button type="warning">Warning</el-button>
|
|
|
|
|
<el-button type="danger">Danger</el-button>
|
|
|
|
|
<el-button @click="addBtn">+</el-button>
|
|
|
|
|
<div>
|
|
|
|
|
<h1>测试store是否引入成功</h1>
|
|
|
|
|
{{ count }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-icon>
|
|
|
|
|
<Edit />
|
|
|
|
|