-
{{item.label}}
-
+
+ {{item.label}}
+
diff --git a/components/radio/demo/basic.vue b/components/radio/demo/basic.vue
new file mode 100644
index 000000000..02c275f0c
--- /dev/null
+++ b/components/radio/demo/basic.vue
@@ -0,0 +1,13 @@
+
+
+ Radio
+
+
+
diff --git a/components/radio/demo/disabled.vue b/components/radio/demo/disabled.vue
new file mode 100644
index 000000000..d21f027ac
--- /dev/null
+++ b/components/radio/demo/disabled.vue
@@ -0,0 +1,31 @@
+
+
+
Disabled
+
+
Disabled
+
+
+
+
diff --git a/components/radio/demo/index.vue b/components/radio/demo/index.vue
new file mode 100644
index 000000000..cf711bade
--- /dev/null
+++ b/components/radio/demo/index.vue
@@ -0,0 +1,42 @@
+
+
+
Basic
+
+ Disabled
+
+ RadioButton
+
+ RadioGroupMore
+
+ RadioGroupOptions
+
+ RadioGroupWithName
+
+ RadioGroup
+
+ Size
+
+
+
+
diff --git a/components/radio/demo/radioButton.vue b/components/radio/demo/radioButton.vue
new file mode 100644
index 000000000..3ee413418
--- /dev/null
+++ b/components/radio/demo/radioButton.vue
@@ -0,0 +1,42 @@
+
+
+
+
+ Hangzhou
+ Shanghai
+ Beijing
+ Chengdu
+
+
+
+
+ Hangzhou
+ Shanghai
+ Beijing
+ Chengdu
+
+
+
+
+ Hangzhou
+ Shanghai
+ Beijing
+ Chengdu
+
+
+
+
+
diff --git a/components/radio/demo/radioGroup-more.vue b/components/radio/demo/radioGroup-more.vue
new file mode 100644
index 000000000..6ade73275
--- /dev/null
+++ b/components/radio/demo/radioGroup-more.vue
@@ -0,0 +1,35 @@
+
+
+ Option A
+ Option B
+ Option C
+
+ More...
+
+
+
+
+
diff --git a/components/radio/demo/radioGroup-options.vue b/components/radio/demo/radioGroup-options.vue
new file mode 100644
index 000000000..6d5f55f14
--- /dev/null
+++ b/components/radio/demo/radioGroup-options.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/components/radio/demo/radioGroup-with-name.vue b/components/radio/demo/radioGroup-with-name.vue
new file mode 100644
index 000000000..ab272d8f7
--- /dev/null
+++ b/components/radio/demo/radioGroup-with-name.vue
@@ -0,0 +1,17 @@
+
+
+ A
+ B
+ C
+ D
+
+
+
diff --git a/components/radio/demo/radioGroup.vue b/components/radio/demo/radioGroup.vue
new file mode 100644
index 000000000..085211370
--- /dev/null
+++ b/components/radio/demo/radioGroup.vue
@@ -0,0 +1,27 @@
+
+
+ A
+ B
+ C
+ D
+
+
+
diff --git a/components/radio/demo/size.vue b/components/radio/demo/size.vue
new file mode 100644
index 000000000..2739cc763
--- /dev/null
+++ b/components/radio/demo/size.vue
@@ -0,0 +1,37 @@
+
+
+
+
+ Hangzhou
+ Shanghai
+ Beijing
+ Chengdu
+
+
+
+
+ Hangzhou
+ Shanghai
+ Beijing
+ Chengdu
+
+
+
+
+ Hangzhou
+ Shanghai
+ Beijing
+ Chengdu
+
+
+
+
+
diff --git a/components/tooltip/tooltip.vue b/components/tooltip/tooltip.vue
index b0e17ff46..97065950d 100644
--- a/components/tooltip/tooltip.vue
+++ b/components/tooltip/tooltip.vue
@@ -9,7 +9,7 @@ export default {
},
placement: {
default: 'top',
- validator: val => ['top', 'left', 'right', 'bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom'].includes(val)
+ validator: val => ['top', 'left', 'right', 'bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom'].includes(val),
},
transitionName: {
default: 'zoom-big-fast',
@@ -47,8 +47,8 @@ export default {
},
},
methods: {
- checkPosition(popup, text, placement) {
- let { top, left, bottom, right } = text
+ checkPosition (popup, text, placement) {
+ const { top, left, bottom, right } = text
const reg = /(top|bottom|left|right)(.*)/
const [, abstractPos, suffix] = placement.match(reg)
let ret = placement
@@ -59,7 +59,7 @@ export default {
if (abstractPos === 'bottom' && document.documentElement.clientHeight - bottom < popup.height) ret = 'left' + suffix
return ret
},
- mountNode(callback) {
+ mountNode (callback) {
if (this.vnode) {
callback()
return
@@ -68,14 +68,14 @@ export default {
document.body.appendChild(div)
const that = this
const vnode = new Vue({
- data() {
+ data () {
return {
left: 0,
top: 0,
}
},
methods: {
- hideSelf(e) {
+ hideSelf (e) {
if (that.t1) {
clearTimeout(that.t1)
that.t1 = null
@@ -88,9 +88,9 @@ export default {
that.visible = false
}, +that.mouseLeaveDelay * 1e3)
}
- }
+ },
},
- render(h) {
+ render (h) {
return (
-
-
-
)
- }
+ },
}).$mount(div)
this.$nextTick(() => {
this.vnode = vnode
@@ -137,7 +137,7 @@ export default {
}
target.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`
},
- addEventHandle(old, fn) {
+ addEventHandle (old, fn) {
if (!old) {
return fn
} else if (Array.isArray(old)) {
@@ -146,7 +146,7 @@ export default {
return old === fn ? old : [old, fn]
}
},
- computeOffset(popup, text, placement, scale) {
+ computeOffset (popup, text, placement, scale) {
let { width, height, top, left } = text
// you cant change the properties of DOMRect
top += window.scrollY
@@ -163,23 +163,23 @@ export default {
// FIXME: magic number 20 & 14 comes from the offset of triangle
if (/Left/.test(placement)) {
if (this.arrowPointAtCenter) ret.left += width / 2 - 20
- } else if(/Right/.test(placement)) {
+ } else if (/Right/.test(placement)) {
ret.left += (width - p.width)
if (this.arrowPointAtCenter) ret.left -= width / 2 - 20
- } else if(/(top)|(bottom)/.test(placement)) {
+ } else if (/(top)|(bottom)/.test(placement)) {
ret.left += (width - p.width) / 2
}
if (/Top/.test(placement)) {
if (this.arrowPointAtCenter) ret.top += height / 2 - 14
- } else if(/Bottom/.test(placement)) {
+ } else if (/Bottom/.test(placement)) {
ret.top += (height - p.height)
if (this.arrowPointAtCenter) ret.top -= height / 2 - 14
- } else if(/(left)|(right)/.test(placement)) {
+ } else if (/(left)|(right)/.test(placement)) {
ret.top += (height - p.height) / 2
}
return ret
},
- showNode() {
+ showNode () {
this.mountNode(() => {
this.visible = true
this.$nextTick(() => {
@@ -192,17 +192,17 @@ export default {
this.vnode.left = left
this.vnode.top = top
})
- this.onPopupAlign(this.realPlacement, this.$el, this.vnode.$el, { offset: [0,0] })
+ this.onPopupAlign(this.realPlacement, this.$el, this.vnode.$el, { offset: [0, 0] })
})
},
- hideNode(e) {
+ hideNode (e) {
if (!this.vnode) return
if (e.relatedTarget === this.vnode.$el) {
return
}
this.visible = false
},
- checkShow(e) {
+ checkShow (e) {
if (this.t2) {
clearTimeout(this.t2)
this.t2 = null
@@ -213,7 +213,7 @@ export default {
}, +this.mouseEnterDelay * 1e3)
}
},
- checkHide(e) {
+ checkHide (e) {
if (this.t1) {
clearTimeout(this.t1)
this.t1 = null
@@ -223,9 +223,9 @@ export default {
this.hideNode(e)
}, +this.mouseLeaveDelay * 1e3)
}
- }
+ },
},
- render(h) {
+ render (h) {
const inner = this.$slots.default[0]
inner.data = inner.data || {}
inner.data.on = inner.data.on || {}
@@ -234,7 +234,7 @@ export default {
return this.$slots.default[0]
},
- updated() {
+ updated () {
if (!this.vnode) return
const popup = this.vnode.$el.getBoundingClientRect()
const [, scale = 1] = window.getComputedStyle(this.vnode.$el).transform.match(/matrix\((.*?),/) || []
@@ -243,10 +243,10 @@ export default {
this.vnode.left = left
this.vnode.top = top
},
- beforeDestroy() {
+ beforeDestroy () {
if (!this.vnode) return
this.vnode.$el.remove()
this.vnode.$destroy()
- }
+ },
}