提交 bbbcb840 编写于 作者: D DCloud_LXH

chore: navigator

上级 683cb341
......@@ -2,6 +2,7 @@ import { getCurrentInstance } from 'vue'
import { useHover } from '../../helpers/useHover'
import { defineBuiltInComponent } from '@dcloudio/uni-components'
import { useAttrs } from '../../helpers/useAttrs'
import { onEventPrevent } from '@dcloudio/uni-core'
const OPEN_TYPES = [
'navigate',
......@@ -58,7 +59,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
props,
setup(props, { slots }) {
const vm = getCurrentInstance()
const __scopeId = (vm?.root?.type as any).__scopeId || ''
const __scopeId = (vm && (vm.root.type as any).__scopeId) || ''
const { $attrs, $excludeAttrs, $listeners } = useAttrs({
excludeListeners: true,
})
......@@ -110,12 +111,9 @@ export default /*#__PURE__*/ defineBuiltInComponent({
const hasHoverClass = props.hoverClass && props.hoverClass !== 'none'
return (
<a
class="navigator-wrap"
href={url}
onClick={(e) => {
e.preventDefault()
return false
}}
style={{ 'text-decoration': 'none' }}
onClick={onEventPrevent}
{...$listeners.value}
>
<uni-navigator
......
......@@ -47,7 +47,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
const nodeList = parseNodes(
nodes,
document.createDocumentFragment(),
(vm?.root?.type as any).__scopeId || '',
(vm && (vm.root.type as any)).__scopeId || '',
hasItemClick && triggerItemClick
)
rootRef.value!.firstElementChild!.innerHTML = ''
......
......@@ -13,3 +13,7 @@ uni-navigator[hidden] {
background-color: rgba(0, 0, 0, 0.1);
opacity: 0.7;
}
.navigator-wrap {
text-decoration: none;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册