1.去掉无用class
2.对循环做一个次数显示和异常处理 Former-commit-id: a2535192478165fa6f11e58b8654f1c996ee8a2d [formerly a5c0e7f9db7727e2913687c49d7b62efc33f45fb] [formerly a2535192478165fa6f11e58b8654f1c996ee8a2d [formerly a5c0e7f9db7727e2913687c49d7b62efc33f45fb] [formerly a2535192478165fa6f11e58b8654f1c996ee8a2d [formerly a5c0e7f9db7727e2913687c49d7b62efc33f45fb] [formerly a5c0e7f9db7727e2913687c49d7b62efc33f45fb [formerly d3990f437c456dd24c5a2e65638734ecb9b361ac [formerly 33b6995a50c01f4fa7e98f0b0bc4d314075ea111]]]]] Former-commit-id: c617fdafc84014336a9d7cdad857bd678f272604 Former-commit-id: e037f2f3ee65aca0739cd9229b188f14835781c2 Former-commit-id: 5c0b40939d7e550fabbb28bbf07aad1d8f528fcf [formerly 73ef97db32e549fec303817a992d574387437cf9] Former-commit-id: 2e97fae10fe583e9d7156f3a17820ba07b8ba7b5 Former-commit-id: 739ccf8c28766b81484debd0679e4fb08b3bcc63 Former-commit-id: de8c953843db51ea0b7fa9aa9ad45a9e801f555f Former-commit-id: f9dd18a6aa1885da96848cc0397647aaed567e52 Former-commit-id: 554515c82b84f9f12442f78edcba36bd6092cf4e
This commit is contained in:
@@ -21,24 +21,31 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'd2-contextmenu-list',
|
||||
props: {
|
||||
menulist: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rowClick (event) {
|
||||
let target = event.target
|
||||
while(!target.dataset.value) {
|
||||
export default {
|
||||
name: 'd2-contextmenu-list',
|
||||
props: {
|
||||
menulist: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rowClick (event) {
|
||||
let target = event.target
|
||||
try {
|
||||
let count = 0
|
||||
while (!target.dataset.value && count < 6) {
|
||||
target = target.parentNode
|
||||
count++
|
||||
}
|
||||
this.$emit('rowClick', target.dataset.value)
|
||||
} catch (error) {
|
||||
// 不做任何处理
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
@edit="handleTabsEdit"
|
||||
@contextmenu.native="handleContextmenu">
|
||||
<el-tab-pane
|
||||
class="hello"
|
||||
v-for="(page, index) in pageOpenedList"
|
||||
:key="index"
|
||||
:label="page.meta.title || '未命名'"
|
||||
|
||||
Reference in New Issue
Block a user