fix
parent
ebc5d64604
commit
fd31801281
|
@ -46,7 +46,7 @@ export function cloneVNodes (vnodes, deep) {
|
||||||
|
|
||||||
export function cloneElement (n, nodeProps, clone) {
|
export function cloneElement (n, nodeProps, clone) {
|
||||||
const node = clone ? cloneVNode(n, true) : n
|
const node = clone ? cloneVNode(n, true) : n
|
||||||
const { props = {}, key, on = {}, listeners = {}} = nodeProps
|
const { props = {}, key, on = {}} = nodeProps
|
||||||
const data = node.data || {}
|
const data = node.data || {}
|
||||||
const { style = data.style,
|
const { style = data.style,
|
||||||
class: cls = data.class,
|
class: cls = data.class,
|
||||||
|
@ -58,9 +58,10 @@ export function cloneElement (n, nodeProps, clone) {
|
||||||
node.componentOptions.propsData = node.componentOptions.propsData || {}
|
node.componentOptions.propsData = node.componentOptions.propsData || {}
|
||||||
node.componentOptions.listeners = node.componentOptions.listeners || {}
|
node.componentOptions.listeners = node.componentOptions.listeners || {}
|
||||||
node.componentOptions.propsData = { ...node.componentOptions.propsData, ...props }
|
node.componentOptions.propsData = { ...node.componentOptions.propsData, ...props }
|
||||||
node.componentOptions.listeners = { ...node.componentOptions.listeners, ...listeners }
|
node.componentOptions.listeners = { ...node.componentOptions.listeners, ...on }
|
||||||
}
|
} else {
|
||||||
node.data.on = { ...(node.data.on || {}), ...on }
|
node.data.on = { ...(node.data.on || {}), ...on }
|
||||||
|
}
|
||||||
|
|
||||||
if (key !== undefined) {
|
if (key !== undefined) {
|
||||||
node.key = key
|
node.key = key
|
||||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render () {
|
render () {
|
||||||
const { htmlType, classes, disabled, handleClick, iconType, $slots, $attrs, _events } = this
|
const { htmlType, classes, disabled, handleClick, iconType, $slots, $attrs, $listeners } = this
|
||||||
const buttonProps = {
|
const buttonProps = {
|
||||||
props: {
|
props: {
|
||||||
},
|
},
|
||||||
|
@ -84,14 +84,10 @@ export default {
|
||||||
},
|
},
|
||||||
class: classes,
|
class: classes,
|
||||||
on: {
|
on: {
|
||||||
|
...$listeners,
|
||||||
click: handleClick,
|
click: handleClick,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for (const [k, event] of Object.entries(_events)) {
|
|
||||||
if (!buttonProps.on[k]) {
|
|
||||||
buttonProps.on[k] = event
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const needInserted = $slots.default && $slots.default.length === 1 && (!iconType || iconType === 'loading')
|
const needInserted = $slots.default && $slots.default.length === 1 && (!iconType || iconType === 'loading')
|
||||||
const kids = $slots.default && $slots.default.length === 1 ? this.insertSpace($slots.default[0], needInserted) : $slots.default
|
const kids = $slots.default && $slots.default.length === 1 ? this.insertSpace($slots.default[0], needInserted) : $slots.default
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -29,6 +29,7 @@ export default {
|
||||||
if (this.clicked) {
|
if (this.clicked) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.clicked = true
|
this.clicked = true
|
||||||
clearTimeout(this.timeout)
|
clearTimeout(this.timeout)
|
||||||
this.timeout = setTimeout(() => (this.clicked = false), 500)
|
this.timeout = setTimeout(() => (this.clicked = false), 500)
|
||||||
|
@ -36,9 +37,19 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render () {
|
render () {
|
||||||
const { title, classes, handleClick } = this
|
const { title, classes, handleClick, $listeners } = this
|
||||||
|
const iconProps = {
|
||||||
|
attrs: {
|
||||||
|
title,
|
||||||
|
},
|
||||||
|
class: classes,
|
||||||
|
on: {
|
||||||
|
...$listeners,
|
||||||
|
click: handleClick,
|
||||||
|
},
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<i title={title} class={classes} onClick={handleClick} />
|
<i {...iconProps}/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
|
|
|
@ -162,7 +162,7 @@ export default {
|
||||||
...extraProps,
|
...extraProps,
|
||||||
openChange: this.onOpenChange,
|
openChange: this.onOpenChange,
|
||||||
},
|
},
|
||||||
listeners: {
|
on: {
|
||||||
click: this.onClick,
|
click: this.onClick,
|
||||||
itemHover: this.onItemHover,
|
itemHover: this.onItemHover,
|
||||||
openChange: this.onOpenChange,
|
openChange: this.onOpenChange,
|
||||||
|
|
|
@ -4,21 +4,11 @@
|
||||||
## 箭头指向
|
## 箭头指向
|
||||||
设置了 `arrowPointAtCenter` 后,箭头将指向目标元素的中心。
|
设置了 `arrowPointAtCenter` 后,箭头将指向目标元素的中心。
|
||||||
</md>
|
</md>
|
||||||
<Tooltip placement="topLeft" title="Prompt Text">
|
<a-tooltip placement="topLeft" title="Prompt Text">
|
||||||
<a-button>Align edge / 边缘对齐</a-button>
|
<a-button>Align edge / 边缘对齐</a-button>
|
||||||
</Tooltip>
|
</a-tooltip>
|
||||||
<Tooltip placement="topLeft" title="Prompt Text" arrowPointAtCenter>
|
<a-tooltip placement="topLeft" title="Prompt Text" arrowPointAtCenter>
|
||||||
<a-button>Arrow points to center / 箭头指向中心</a-button>
|
<a-button>Arrow points to center / 箭头指向中心</a-button>
|
||||||
</Tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import { Tooltip, Button } from 'antd'
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Tooltip,
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
|
@ -493,13 +493,12 @@ export default {
|
||||||
props: {},
|
props: {},
|
||||||
on: { _ANT_EVENT_HACK: () => {} },
|
on: { _ANT_EVENT_HACK: () => {} },
|
||||||
key: 'trigger',
|
key: 'trigger',
|
||||||
listeners: {},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isContextMenuToShow()) {
|
if (this.isContextMenuToShow()) {
|
||||||
newChildProps.listeners.contextMenu = this.onContextMenu
|
newChildProps.on.contextMenu = this.onContextMenu
|
||||||
} else {
|
} else {
|
||||||
newChildProps.listeners.contextMenu = this.createTwoChains('contextMenu')
|
newChildProps.on.contextMenu = this.createTwoChains('contextMenu')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isClickToHide() || this.isClickToShow()) {
|
if (this.isClickToHide() || this.isClickToShow()) {
|
||||||
|
|
|
@ -51,9 +51,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
test () {
|
|
||||||
console.log(122)
|
|
||||||
},
|
|
||||||
toggle () {
|
toggle () {
|
||||||
this.isOpen = !this.isOpen
|
this.isOpen = !this.isOpen
|
||||||
},
|
},
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
"less": "^2.7.2",
|
"less": "^2.7.2",
|
||||||
"less-loader": "^4.0.5",
|
"less-loader": "^4.0.5",
|
||||||
"markdown-it": "^8.4.0",
|
"markdown-it": "^8.4.0",
|
||||||
"markdown-it-anchor": "^4.0.0",
|
|
||||||
"marked": "^0.3.7",
|
"marked": "^0.3.7",
|
||||||
"mocha": "^3.2.0",
|
"mocha": "^3.2.0",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
|
@ -75,7 +74,6 @@
|
||||||
"style-loader": "^0.18.2",
|
"style-loader": "^0.18.2",
|
||||||
"stylelint": "^8.1.1",
|
"stylelint": "^8.1.1",
|
||||||
"stylelint-config-standard": "^17.0.0",
|
"stylelint-config-standard": "^17.0.0",
|
||||||
"transliteration": "^1.6.2",
|
|
||||||
"vue-antd-md-loader": "^1.0.2",
|
"vue-antd-md-loader": "^1.0.2",
|
||||||
"vue-loader": "^13.0.5",
|
"vue-loader": "^13.0.5",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const slugify = require('transliteration').slugify
|
|
||||||
const hljs = require('highlight.js')
|
const hljs = require('highlight.js')
|
||||||
const Token = require('markdown-it/lib/token')
|
const Token = require('markdown-it/lib/token')
|
||||||
const cheerio = require('cheerio')
|
const cheerio = require('cheerio')
|
||||||
|
@ -36,15 +35,6 @@ const renderHighlight = function (str, lang) {
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function wrap (render) {
|
|
||||||
return function (tokens) {
|
|
||||||
return render.apply(this, arguments)
|
|
||||||
.replace('<code class="', '<code class="hljs ')
|
|
||||||
.replace('<code>', '<code class="hljs">')
|
|
||||||
.replace('<pre>', '<pre class="code-section">')
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const md = require('markdown-it')('default', {
|
const md = require('markdown-it')('default', {
|
||||||
html: true,
|
html: true,
|
||||||
breaks: true,
|
breaks: true,
|
||||||
|
|
Loading…
Reference in New Issue