Fix potential namespace conflicts

This commit is contained in:
jiaming743 2019-07-22 18:56:49 +08:00
parent 2d316d3629
commit a92e36067b
1 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,7 @@ export default {
}, },
data () { data () {
return { return {
render: null, renderer: null,
defaultConfig: { defaultConfig: {
/** /**
@ -100,7 +100,7 @@ export default {
initRender () { initRender () {
const { $refs } = this const { $refs } = this
this.render = new CRender($refs['digital-flop']) this.renderer = new CRender($refs['digital-flop'])
}, },
mergeConfig () { mergeConfig () {
const { defaultConfig, config } = this const { defaultConfig, config } = this
@ -108,14 +108,14 @@ export default {
this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {}) this.mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})
}, },
initGraph () { initGraph () {
const { getShape, getStyle, render, mergedConfig } = this const { getShape, getStyle, renderer, mergedConfig } = this
const { animationCurve, animationFrame } = mergedConfig const { animationCurve, animationFrame } = mergedConfig
const shape = getShape() const shape = getShape()
const style = getStyle() const style = getStyle()
this.graph = render.add({ this.graph = renderer.add({
name: 'numberText', name: 'numberText',
animationCurve, animationCurve,
animationFrame, animationFrame,
@ -126,7 +126,7 @@ export default {
getShape () { getShape () {
const { number, content, toFixed, textAlign } = this.mergedConfig const { number, content, toFixed, textAlign } = this.mergedConfig
const [w, h] = this.render.area const [w, h] = this.renderer.area
const position = [w / 2, h / 2] const position = [w / 2, h / 2]