feat: makeClassNameByUrl
This commit is contained in:
parent
e84827e900
commit
a019df4c20
|
|
@ -16,7 +16,7 @@
|
|||
<script>
|
||||
import { makeNameByUrl } from 'd2/utils/component.js'
|
||||
import { useMenuMainStore } from 'd2/store/menu-main.js'
|
||||
import { computed, watch } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { compact } from 'lodash-es'
|
||||
import { storeToRefs } from 'pinia'
|
||||
|
|
@ -41,14 +41,6 @@ export default {
|
|||
|
||||
const selectedKey = computed(() => getMenuId(getMenuByUrl(route.fullPath)))
|
||||
|
||||
watch(() => route.fullPath, value => {
|
||||
console.log('route.fullPath', value)
|
||||
})
|
||||
|
||||
watch(selectedKey, value => {
|
||||
console.log('selectedKey', value)
|
||||
})
|
||||
|
||||
const selectedKeys = computed(() => compact([selectedKey.value]))
|
||||
|
||||
const openKeys = computed(() => getMenuPids(selectedKey.value))
|
||||
|
|
|
|||
|
|
@ -60,5 +60,5 @@ export function makeClassName (name) {
|
|||
* @returns {string} component name. eg: 'name-space-foo-bar'
|
||||
*/
|
||||
export function makeClassNameByUrl (url) {
|
||||
return kebabCase(camelCase(makeNameByUrl(url)))
|
||||
return kebabCase(makeNameByUrl(url)).replace(/-(\d)/g, '$1')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue