<template>
<div class="water">
<canvas id="canvas"></canvas>
</div>
</template>
<script>
export default {
name: "Water",
mounted() {
var canvas = document.getElementById("canvas");
var width = window.innerWidth;
var height = window.innerHeight;
canvas.setAttribute("width", width + "px");
canvas.setAttribute("height", height + "px");
var ctx = canvas.getContext("2d");
var word1 = "王小明";
var word2 = "15168836829";
var word = word1 + word2;
var fontSize = 20;
var fontLength =
word1.length * fontSize + (word2.length * fontSize) / 2 - 5;
var widthStep = width / fontLength;
var heigtStep = height / fontSize;
ctx.fillStyle = "blue";
function r