发表日期: 2021-05-25 10:46:58 浏览次数:135
安溪网站制作要多少钱【域名企业邮箱服务器注册申请办理】安溪网络优化公司哪家好、安溪软件开发外包价格、安溪高端企业网站页面制作设计专业公司、安溪微信公众号小程序购物支付搭建制作公司

安溪县,古称清溪,位于福建省东南沿海,厦、漳、泉闽南金三角西北部,隶属泉州市。总面积3057.28平方千米,辖15个镇和9个乡,2019年末户籍人口121.10万。全县建成区面积28平方千米 [1] 。1985年,被国家批准为首批沿海对外开放县之一,是台胞的主要祖籍地。
安溪有上千年的产茶历史,是“中国乌龙茶(名茶)之乡”、安溪铁观音的发源地,位居中国重点产茶县第一位,以茶业闻名全中国,号称“中国茶都”。
安溪还是“中国藤铁工艺之乡”和“世界藤铁工艺之都” [2] ,工艺品畅销世界50多个国家和地区,占中国同类产品交易额40%。
2019年,安溪县实现地区生产总值731.49亿元。 [3] 2019年,被评为全国综合实力百强县市第60位 [4] 、全国投资潜力百强县市第21位 [5] 、全国科技创新百强县市第77位 [6] 、全国绿色发展百强县市第54位 [7] 、全国新型城镇化质量百强县市第56位 [8] ;第二批国家农产品质量安全县。 [9-10] 2020年10月9日,被生态环境部授予第四批国家生态文明建设示范市县称号。11月,入选 “2020年中国工业百强县(市)”,排名第83位。 [11]
在手机上展示我们的标题的时候,我们当前的场景不允许出现两行,但是空间只有那么大,还要让用户看到完整的信息,所以采用超出滚动的方式来解决当前的问题。
原生的marquee标签中间包裹文字就可以滚动,但是显然不符合我们想要的。
通过vue实现文本超出滚动
<template>
<div class="marquee-wrap" ref="marquee-wrap">
<div class="scroll" ref="scroll">
<p class="marquee">{{text}}</p>
<p class="copy" ref="copy"></p>
</div>
<p class="getWidth" ref="getWidth">{{text}}</p>
</div>
</template>
<script>
export default {
name: 'marquee',
props: ['val'],
data () {
return {
timer: null,
text: ''
}
},
created () {
let timer = setTimeout(() => {
this.move()
clearTimeout(timer)
}, 1000)
},
mounted () {
for (let item of this.val) {
this.text += item
}
},
methods: {
move () {
let maxWidth = this.$refs['marquee-wrap'].clientWidth
let width = this.$refs['getWidth'].scrollWidth
if (width <= maxWidth) return
let scroll = this.$refs['scroll']
let copy = this.$refs['copy']
copy.innerText = this.text
let distance = 0
this.timer = setInterval(() => {
distance -= 1
if (-distance >= width) {
distance = 16
}
scroll.style.transform = 'translateX(' + distance + 'px)'
}, 20)
}
},
beforeDestroy () {
clearInterval(this.timer)
}
}
</script>
<style scoped>
.marquee-wrap {
width: 100%;
overflow: hidden;
position: relative;
}
.marquee{
margin-right: 0.16rem;
}
p {
word-break:keep-all;
white-space: nowrap;
font-size: 0.28rem;
}
.scroll {
display: flex;
}
.getWidth {
word-break:keep-all;
white-space:nowrap;
position: absolute;
opacity: 0;
top: 0;
}
</style>使用组件
//引入组件 import Marquee from './marquee' //注册并使用 <Marquee :val=""></Marquee>
安溪网站制作要多少钱【域名企业邮箱服务器注册申请办理】安溪网络优化公司哪家好、安溪软件开发外包价格、安溪高端企业网站页面制作设计专业公司、安溪微信公众号小程序购物支付搭建制作公司