|
@@ -1,6 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<div class="chart-container">
|
|
<div class="chart-container">
|
|
- <div ref="chart" class="ring-chart" @mousedown="begin" @mousemove="moving" @mouseup="stopMoving"></div>
|
|
|
|
|
|
+ <div id="ring-chart" ref="chart" class="ring-chart"
|
|
|
|
+ @mousedown="begin" @mousemove="moving" @mouseup="stopMoving"
|
|
|
|
+ ></div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -149,6 +151,11 @@
|
|
const center_y = top + height / 2
|
|
const center_y = top + height / 2
|
|
|
|
|
|
function init() {
|
|
function init() {
|
|
|
|
+ let chartDiv = document.getElementById("ring-chart");
|
|
|
|
+ console.log("sss",chartDiv)
|
|
|
|
+ chartDiv.addEventListener('touchstart',begin)
|
|
|
|
+ chartDiv.addEventListener('touchmove',moving)
|
|
|
|
+ chartDiv.addEventListener('touchend',stopMoving)
|
|
console.log(center_x, "***", center_y)
|
|
console.log(center_x, "***", center_y)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -193,7 +200,13 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- init()
|
|
|
|
|
|
+ onMounted(()=>{
|
|
|
|
+ nextTick(()=>{
|
|
|
|
+ init()
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|