Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
前端:MenuList组件修改为setup语法
  • Loading branch information
4linuxfun committed Jan 10, 2023
commit f540c7d1267052966544f9fb48d868990adaef2d
31 changes: 15 additions & 16 deletions www/src/components/MenuList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,24 @@
</el-menu>
</template>

<script>
<script setup>
import {useStore} from '@/stores'
import {mapState} from 'pinia'
import {computed} from 'vue'

export default {
computed: {
...mapState(useStore, {
menuList: 'asyncRoutes'
})
},
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath)
},
handleClose(key, keyPath) {
console.log(key, keyPath)
}
}
const userStore = useStore()

const menuList = computed(() => {
return userStore.asyncRoutes
})

function handleOpen(key, keyPath) {
console.log(key, keyPath)
}

function handleClose(key, keyPath) {
console.log(key, keyPath)
}

</script>

<style>
Expand Down