feat:后台设置页面
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useAdminData = defineStore('adminData', () => {
|
||||
const adminPassword = ref(localStorage.getItem('adminPassword') || '')
|
||||
function updateAdminPwd(pwd: string) {
|
||||
adminPassword.value = pwd
|
||||
localStorage.setItem('token', pwd)
|
||||
}
|
||||
return { adminPassword, updateAdminPwd }
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return { count, doubleCount, increment }
|
||||
})
|
||||
Reference in New Issue
Block a user