Browse Source

save

pull/44/head
zyronon 1 year ago
parent
commit
e618702ea7
  1. 3
      src/App.vue
  2. 47
      src/pages/test/Test.vue
  3. 2
      src/router/index.js

3
src/App.vue

@ -38,7 +38,8 @@ export default {
//footer5 //footer5
let noAnimation = ['/', '/home', '/slide', '/me', '/shop', '/message', '/publish', '/home/live', let noAnimation = ['/', '/home', '/slide', '/me', '/shop', '/message', '/publish', '/home/live',
'slide' 'slide',
'/test',
] ]
if (noAnimation.indexOf(from.path) !== -1 && noAnimation.indexOf(to.path) !== -1) { if (noAnimation.indexOf(from.path) !== -1 && noAnimation.indexOf(to.path) !== -1) {
return this.transitionName = '' return this.transitionName = ''

47
src/pages/test/Test.vue

@ -1,29 +1,31 @@
<template> <template>
<div> <div class="body">
test test
<canvas ref="canvasEl"></canvas>
<!-- <video ref="videoEl" :src="v1" controls></video>-->
</div> </div>
</template> </template>
<script> <script setup>
import {onMounted, ref} from "vue";
export default { defineOptions({
name: "Test", name: 'Test'
components: {}, })
data() { const canvasEl = ref()
return { const videoEl = ref()
src: '', onMounted(() => {
rect: {x: 0, y: 0} console.log(canvasEl.value, videoEl.value)
} let ctx = canvasEl.value.getContext('2d')
}, videoEl.value.addEventListener('play', () => {
methods: { console.log(videoEl.value.videoWidth)
wheel() { console.log(videoEl.value.videoHeight)
// ctx.drawImage(videoEl.value, 0, 0, videoEl.value.videoWidth / 20, videoEl.value.videoHeight / 20);
ctx.drawImage(videoEl.value, 0, 0, videoEl.value.naturalWidth, videoEl.value.naturalHeight);
// ctx.drawImage(videoEl.value, 0, 0, 500, 500);
})
})
}
},
mounted() {
}
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.body { .body {
@ -36,6 +38,13 @@ export default {
width: 100vw; width: 100vw;
overflow: hidden; overflow: hidden;
transform-origin: 0 0; transform-origin: 0 0;
color: white;
font-size: 14px;
}
video, canvas {
width: 500px;
height: 500px;
} }
.wrapper { .wrapper {

2
src/router/index.js

@ -17,7 +17,7 @@ const router = VueRouter.createRouter({
router.beforeEach((to, from) => { router.beforeEach((to, from) => {
const baseStore = useBaseStore() const baseStore = useBaseStore()
//footer下面的5个按钮,对跳不要用动画 //footer下面的5个按钮,对跳不要用动画
let noAnimation = ['/', '/home', '/me', '/shop', '/message', '/publish', '/home/live'] let noAnimation = ['/', '/home', '/me', '/shop', '/message', '/publish', '/home/live', '/test']
if (noAnimation.indexOf(from.path) !== -1 && noAnimation.indexOf(to.path) !== -1) { if (noAnimation.indexOf(from.path) !== -1 && noAnimation.indexOf(to.path) !== -1) {
return true return true
} }

Loading…
Cancel
Save