欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue實(shí)現(xiàn)滑動(dòng)和滾動(dòng)效果

 更新時(shí)間:2022年03月08日 08:26:47   作者:小靜仔  
這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)滑動(dòng)和滾動(dòng)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue實(shí)現(xiàn)滑動(dòng)和滾動(dòng)效果的具體代碼,供大家參考,具體內(nèi)容如下

面板滑動(dòng)效果,父組件是resultPanel,子組件是resultOption,仿照了iview中,Select組件的寫(xiě)法。

<template>
? <div v-if="visiable">
? ? <div class="transparent" :class="{active:resultPanelStatus==='top'}"></div>
? ? <div class="mapbox-result"
? ? ? ? ?ref="resultPanel"
? ? ? ? ?style="z-index: 101;"
? ? ? ? ?@touchstart="onTouchStart"
? ? ? ? ?@touchmove="onTouchMove"
? ? ? ? ?@touchend="onTouchEnd"
? ? ? ? ?:style="slideEffect"
? ? >
? ? ? <div class="mapbox-result-content">
? ? ? ? <a class="mapbox-result-close" v-if="closable" @click="close"></a>
? ? ? ? <div class="mapbox-result-header">
? ? ? ? ? <slot name="header">
? ? ? ? ? ? <div class="mapbox-result-header-title">共找到【{{header}}】相關(guān){{total}}結(jié)果</div>
? ? ? ? ? </slot>
? ? ? ? </div>
? ? ? ? <div
? ? ? ? ? class="mapbox-result-body"
? ? ? ? ? ref="resultBody"
? ? ? ? >
? ? ? ? ? <result-option
? ? ? ? ? ? ref="option"
? ? ? ? ? ? v-for="(item, index) in data"
? ? ? ? ? ? :index="index+1"
? ? ? ? ? ? :name="item.name"
? ? ? ? ? ? :meter="item.meter?item.meter:0"
? ? ? ? ? ? :floor-name="item.floorName"
? ? ? ? ? ? :key="index"
? ? ? ? ? ? v-show="visiable"
? ? ? ? ? ? @on-click-gohere="handleNavigate(index)"
? ? ? ? ? ? @on-click-item="focusResultOnMap(index)"
? ? ? ? ? ></result-option>
? ? ? ? </div>
? ? ? </div>
? ? </div>
? </div>
</template>
<script>
? import resultOption from './resultOption';
?
? export default {
? ? name: 'result-panel',
? ? components: {resultOption},
? ? props: {
? ? ? header: {
? ? ? ? type: String
? ? ? },
? ? ? // value: {
? ? ? // ? type: Boolean,
? ? ? // ? default: true
? ? ? // },
? ? ? closable: {
? ? ? ? type: Boolean,
? ? ? ? default: true
? ? ? },
? ? ? data: {
? ? ? ? type: Array,
? ? ? ? default: []
? ? ? }
? ? },
? ? data() {
? ? ? return {
? ? ? ? // visiable: true,
? ? ? ? resultPanelStatus: 'normal', ? ?//'normal'、'top'
? ? ? ? cloneData: this.deepCopy(this.data),
? ? ? ? startY: 0, ?// 開(kāi)始觸摸屏幕的點(diǎn)
? ? ? ? endY: 0, ? // 離開(kāi)屏幕的點(diǎn)
? ? ? ? moveY: 0, ?// 滑動(dòng)時(shí)的距離
? ? ? ? disY: 0, ?// 移動(dòng)距離
? ? ? ? slideEffect: '' ? ? ?//滑動(dòng)效果
? ? ? }
? ? },
? ? mounted() {
? ? ? // this.$refs.resultBody.style.height = `${this.defaultHeight - 60}px`;
? ? ? // this.$refs.resultBody.style.overflowY = 'hidden';
? ? },
? ? computed: {
? ? ? total() {
? ? ? ? return this.data.length;
? ? ? },
? ? ? defaultHeight() {
? ? ? ? return this.data.length > 3 ? 240 : this.data.length * 60 + 60 ? ? ? ?//當(dāng)結(jié)果大于3時(shí),默認(rèn)只顯示三個(gè)
? ? ? },
? ? ? visiable() {
? ? ? ? this.resultPanelStatus = 'normal';
? ? ? ? this.slideEffect = `transform: translateY(-${this.defaultHeight}px); transition: all .5s`;
? ? ? ? return this.$store.state.resultPanel.show;
? ? ? }
? ? },
? ? methods: {
? ? ? /**
? ? ? ?* 手指接觸屏幕
? ? ? ?*/
? ? ? onTouchStart(ev) {
? ? ? ? ev = ev || event;
? ? ? ? // ev.preventDefault();
? ? ? ? if (ev.touches.length === 1) {
? ? ? ? ? this.startY = ev.touches[0].clientY;
? ? ? ? }
? ? ? },
?
? ? ? /**
? ? ? ?* 手指滑動(dòng)
? ? ? ?*/
? ? ? onTouchMove(ev) {
? ? ? ? ev = ev || event;
? ? ? ? console.log("ev.target: ", ev.target);
? ? ? ? // ev.preventDefault();
? ? ? ? if (ev.touches.length === 1) {
? ? ? ? ? let resultPanel = this.$refs.resultPanel.offsetHeight;
? ? ? ? ? this.moveY = ev.touches[0].clientY;
? ? ? ? ? this.disY = this.moveY - this.startY;
? ? ? ? ? if (this.disY < 0 && -this.defaultHeight + this.disY > -resultPanel && this.resultPanelStatus === 'normal') { ?//向上滑動(dòng)
? ? ? ? ? ? this.slideEffect = `transform: translateY(${-this.defaultHeight + this.disY}px); transition: all 0s;`;
? ? ? ? ? ? //內(nèi)容隨著面板上滑出現(xiàn)的動(dòng)畫(huà)
? ? ? ? ? ? this.$refs.resultBody.style.transition = 'all .5s';
? ? ? ? ? ? this.$refs.resultBody.style.height = `${this.$refs.resultPanel.offsetHeight - 60}px`;
? ? ? ? ? } else if (this.resultPanelStatus === 'top' && this.disY < 0) {
? ? ? ? ? ? this.scroll();
? ? ? ? ? } else if (this.disY > 0 && this.resultPanelStatus === 'top') { ? ? ?//向下滑動(dòng)
/*當(dāng)手指向下滑動(dòng)時(shí),如果滑動(dòng)的起始點(diǎn)不在非內(nèi)容區(qū)以及scrollTop不為0,則為滾動(dòng),否則面板隨著手指滑動(dòng)并隱藏滾動(dòng)條,以防止下滑過(guò)程中,能夠滾動(dòng)數(shù)據(jù)*/
? ? ? ? ? ? if (this.$refs.resultBody.scrollTop > 0 && ev.target !== document.getElementsByClassName("mapbox-result-header")[0]) {
? ? ? ? ? ? ? this.scroll();
? ? ? ? ? ? } else {
? ? ? ? ? ? ? this.slideEffect = `transform: translateY(${-resultPanel + this.disY}px); transition: all 0s`;
? ? ? ? ? ? ? this.$refs.resultBody.style.overflowY = 'hidden';
? ? ? ? ? ? } ? //當(dāng)處于normal狀態(tài),手指向下滑,則下滑
? ? ? ? ? } else if (this.disY > 0 && this.resultPanelStatus === 'normal') {
? ? ? ? ? ? this.slideEffect = `transform: translateY(${-this.defaultHeight + this.disY}px); transition: all 0s`;
? ? ? ? ? }
? ? ? ? }
? ? ? },
?
? ? ? /**
? ? ? ?* 離開(kāi)屏幕
? ? ? ?*/
? ? ? onTouchEnd(ev) {
? ? ? ? ev = ev || event;
? ? ? ? // ev.preventDefault();
? ? ? ? if (ev.changedTouches.length === 1) {
? ? ? ? ? this.endY = ev.changedTouches[0].clientY;
? ? ? ? ? this.disY = this.endY - this.startY;
? ? ? ? ? if (this.disY > 0 && this.resultPanelStatus === 'top') { ? //向下滑動(dòng)
? ? ?/*當(dāng)手指向下滑動(dòng)時(shí),如果滑動(dòng)的起始點(diǎn)不在非內(nèi)容區(qū)以及scrollTop不為0,則為滾動(dòng),否則面板滑動(dòng)到默認(rèn)位置*/
? ? ? ? ? ? if (this.$refs.resultBody.scrollTop > 0 && ev.target !== document.getElementsByClassName("mapbox-result-header")[0]) { ??
? ? ? ? ? ? ? this.scroll();
? ? ? ? ? ? } else { ?
? ? ? ? ? ? ? this.normal();
? ? ? ? ? ? }
//手指離開(kāi)的時(shí)候,出現(xiàn)滾動(dòng)條,已解決第一次滑動(dòng)內(nèi)容的時(shí)候,滾動(dòng)條才會(huì)出現(xiàn)而內(nèi)容沒(méi)有滑動(dòng)的問(wèn)題
? ? ? ? ? } else if (this.disY < 0 && this.resultPanelStatus === 'normal') { ? //向上滑動(dòng)
? ? ? ? ? ? this.top();
? ? ? ? ? ? this.move();
? ? ? ? ? } else if (this.disY < 0 && this.resultPanelStatus === 'top') {
? ? ? ? ? ? this.scroll();
? ? ? ? ? } else if (this.disY > 0 && this.resultPanelStatus === 'normal') {
? ? ? ? ? ? this.normal(); ? //處于normal狀態(tài)下滑,手指離開(kāi)屏幕,回歸normal狀態(tài)
? ? ? ? ? }
? ? ? ? }
? ? ? },
?
//當(dāng)?shù)侥J(rèn)高度時(shí),設(shè)置狀態(tài)為正常狀態(tài),并且隱藏滾動(dòng)條,將scrollTop置0,以避免內(nèi)前面的內(nèi)容被隱藏
? ? ? normal() {
? ? ? ? // this.$refs.resultBody.style.overflowY = 'hidden';
? ? ? ? this.slideEffect = `transform: translateY(${-this.defaultHeight}px); transition: all .5s;`;
? ? ? ? this.resultPanelStatus = 'normal';
? ? ? ? this.$refs.resultBody.scrollTop = 0;
? ? ? },
?
? ? ? top() {
? ? ? ? this.slideEffect = 'transform: translateY(-100%); transition: all .5s;';
? ? ? ? this.resultPanelStatus = 'top';
? ? ? },
?
? ? ? move() {
? ? ? ? // this.$refs.resultBody.style.height = `${-this.disY + this.defaultHeight}px`;
? ? ? ? this.$refs.resultBody.style.overflowY = 'auto';
? ? ? },
?
? ? ? scroll() {
? ? ? ? this.$refs.resultBody.style.overflowY = 'auto';
? ? ? },
?
? ? ? close(ev) { ?// click事件會(huì)和touchestart事件沖突
? ? ? ? //當(dāng)面板處于最高狀態(tài)被關(guān)閉時(shí),恢復(fù)到正常高度狀態(tài),以避免下次打開(kāi)仍處于最高處
? ? ? ? this.normal();
? ? ? ? // this.$refs.resultBody.scrollTop = 0;
? ? ? ? // this.$refs.resultBody.style.overflowY = 'hidden';
? ? ? ? this.$store.state.resultPanel.show = false;
? ? ? ? this.$emit('on-cancel');
? ? ? },
?
? ? ? handleNavigate(_index) {
? ? ? ? // this.$emit("on-item-click", JSON.parse(JSON.stringify(this.cloneData[_index])), _index); ?//這個(gè)是獲取行的元素,和索引
? ? ? ? this.$emit("on-click-gohere", _index); ?// 這個(gè)是獲取索引
? ? ? },
? ? ? focusResultOnMap(_index) {
? ? ? ? this.$emit("on-click-item", _index); ?// 這個(gè)是獲取索引
? ? ? },
? ? ? // deepCopy
? ? ? deepCopy(data) {
? ? ? ? const t = this.typeOf(data);
? ? ? ? let o;
?
? ? ? ? if (t === 'array') {
? ? ? ? ? o = [];
? ? ? ? } else if (t === 'object') {
? ? ? ? ? o = {};
? ? ? ? } else {
? ? ? ? ? return data;
? ? ? ? }
?
? ? ? ? if (t === 'array') {
? ? ? ? ? for (let i = 0; i < data.length; i++) {
? ? ? ? ? ? o.push(this.deepCopy(data[i]));
? ? ? ? ? }
? ? ? ? } else if (t === 'object') {
? ? ? ? ? for (let i in data) {
? ? ? ? ? ? o[i] = this.deepCopy(data[i]);
? ? ? ? ? }
? ? ? ? }
? ? ? ? return o;
? ? ? },
?
? ? ? typeOf(obj) {
? ? ? ? const toString = Object.prototype.toString;
? ? ? ? const map = {
? ? ? ? ? '[object Boolean]': 'boolean',
? ? ? ? ? '[object Number]': 'number',
? ? ? ? ? '[object String]': 'string',
? ? ? ? ? '[object Function]': 'function',
? ? ? ? ? '[object Array]': 'array',
? ? ? ? ? '[object Date]': 'date',
? ? ? ? ? '[object RegExp]': 'regExp',
? ? ? ? ? '[object Undefined]': 'undefined',
? ? ? ? ? '[object Null]': 'null',
? ? ? ? ? '[object Object]': 'object'
? ? ? ? };
? ? ? ? return map[toString.call(obj)];
? ? ? }
? ? }
? }
</script>
?
<style type="text/less" scoped>
//scoped是指這個(gè)樣式只能用于當(dāng)前組件
? .transparent {
? ? bottom: 0;
? ? left: 0;
? ? position: absolute;
? ? right: 0;
? ? top: 0;
? ? background-color: rgba(0, 0, 0, 0.3);
? ? opacity: 0;
? ? transition: opacity .3s;
? ? z-index: -1000000000;
? }
?
? .transparent.active {
? ? opacity: 1;
? ? z-index: 0;
? }
?
? .mapbox-result {
? ? height: calc(100% - 2.8vw);
? ? background: #fff;
? ? position: absolute;
? ? font-family: PingFangSC-Regular;
? ? font-size: 12px;
? ? color: #4A4A4A;
? ? bottom: 0;
? ? width: 94.4vw;
? ? margin: 0 2.8vw;
? ? outline: 0;
? ? overflow: auto;
? ? box-sizing: border-box;
? ? top: 100%;
? ? overflow: hidden;
? ? border-radius: 5px 5px 0 0;
? ? box-shadow: 0 0 12px 0px rgba(153, 153, 153, 0.25);
? }
?
? .mapbox-result-content {
? ? position: relative;
? ? background-color: #fff;
? ? border: 0;
? }
?
? .mapbox-result-header {
? ? padding: 24px 10vw;
? ? line-height: 1;
? ? text-align: center;
? }
?
? .mapbox-result-header-title {
? ? white-space: nowrap;
? }
?
? .mapbox-result-close {
? ? position: absolute;
? ? width: 16px;
? ? height: 16px;
? ? background: url('../../assets/close-black@2x.png');
? ? background-size: 100% 100%;
? ? background-repeat: no-repeat;
? ? right: 5.6vw;
? ? top: 22px
? }
?
? .mapbox-result-body {
? ? height: auto;
? }
</style>
<template>
? <div class="mapbox-result-option">
? ? <div class="mapbox-result-option-content">
? ? ? <!--<button class="mapbox-btn mapbox-btn-primary mapbox-result-option-btn mapbox-btn-right" @click="handleClick">
? ? ? ? <i class="mapbox-result-option-icon"></i>
? ? ? </button>-->
? ? ? <a class="mapbox-result-option-nav" @click="handleClick"></a>
? ? ? <div class="mapbox-result-option-item" @click="resultItemClick">
? ? ? ? <div class="mapbox-result-option-item-main">
? ? ? ? ? <p class="mapbox-result-option-title">
? ? ? ? ? ? <span class="mapbox-result-option-order">{{index}}</span>
? ? ? ? ? ? {{name}}
? ? ? ? ? </p>
? ? ? ? ? <p class="mapbox-result-option-note">
? ? ? ? ? ? {{floorName}},距離當(dāng)前位置{{meter}}米
? ? ? ? ? </p>
? ? ? ? </div>
? ? ? </div>
? ? </div>
? </div>
</template>
<script>
? export default {
? ? name: 'result-option',
? ? props: {
? ? ? value: {
? ? ? ? type: Boolean,
? ? ? ? default: true
? ? ? },
? ? ? index: {
? ? ? ? type: Number
? ? ? },
? ? ? name: {
? ? ? ? type: String
? ? ? },
? ? ? meter: {
? ? ? ? type: Number
? ? ? },
? ? ? floorName: {
? ? ? ? type: String
? ? ? }
? ? },
? ? data() {
? ? ? return {
? ? ? }
? ? },
? ? methods: {
? ? ? handleClick() {
? ? ? ? this.$emit("on-click-gohere");
? ? ? },
? ? ? resultItemClick() {
? ? ? ? this.$emit("on-click-item");
? ? ? }
? ? }
? }
?
</script>
<style type="text/less" scoped>
? .mapbox-result-option {
? ? height: 60px;
? ? width: calc(100% - 8.3vw);
? ? display: block;
? ? border-bottom: 1px solid #dbd6d6;
? ? box-sizing: border-box;
? ? margin: 0 auto;
? ? overflow: hidden;
? }
?
? .mapbox-result-option-content {
? ? padding: 0;
? ? margin: 0;
? ? font-family: PingFangSC-Regular;
? ? font-size: 12px;
? ? color: #4A4A4A;
? ? position: relative;
? ? display: inline-block;
? ? width: 100%;
? }
?
? .mapbox-btn {
? ? display: inline-block;
? ? margin-bottom: 0;
? ? font-weight: 400;
? ? text-align: center;
? ? vertical-align: middle;
? ? touch-action: manipulation;
? ? background-image: none;
? ? border: 1px solid transparent;
? ? white-space: nowrap;
? ? line-height: 1.5;
? }
?
? .mapbox-result-option-btn {
? ? position: relative;
? ? border-radius: 50%;
? ? height: 30px;
? ? width: 8.3vw;
? ? padding: 0;
? ? outline: none;
? ? margin: 15px 4.2vw 15px 0;
? ? z-index: 1; ?/*避免文字擋住了按鈕*/
? }
?
? .mapbox-btn-primary {
? ? color: #fff;
? ? background-color: #2A70FE;
? ? border-color: #2A70FE;
? }
?
? .mapbox-btn-right {
? ? float: right;
? ? margin-right: 4.2vw;
? }
?
? .mapbox-result-option-icon {
? ? position: absolute;
? ? top: 50%;
? ? left: 50%;
? ? transform: translate(-50%, -50%);
? ? background-size: 100% 100%;
? ? width: 2.9vw;
? ? height: 18px;
? ? background: url("../../../static/image/icon_nav3.png") no-repeat;
? }
? .mapbox-result-option-nav {
? ? background: url("../../assets/btn_route_planning_normal.png");
? ? width: 30px;
? ? height: 30px;
? ? background-size: 100% 100%;
? ? background-repeat: no-repeat;
? ? float: right;
? ? display: block;
? ? position: absolute;
? ? right: 0;
? ? top: 15px;
? ? z-index: 1;
? }
?
? .mapbox-result-option-item {
? ? display: block;
? ? position: relative;
? ? margin: 10px auto;
? }
?
? .mapbox-result-option-item-main {
? ? display: block;
? ? vertical-align: middle;
? ? font-size: 16px;
? ? color: #4A4A4A;
? }
?
? .mapbox-result-option-title {
? ? font: 15px/21px PingFangSC-Regular;
? ? position: relative;
? }
?
? .mapbox-result-option-order {
? ? font: 15px/21px PingFangSC-Medium;
? ? position: relative;
? ? margin-left: 1.9vw;
? ? margin-right: 4.6vw;
? }
?
? .mapbox-result-option-note {
? ? font: 12px/16px PingFangSC-Regular;
? ? color: #9B9B9B;
? ? white-space: normal;
? ? position: relative;
? ? margin-left: 12.5vw;
? ? margin-top: 3px;
? }
</style>

ev = ev || event,這個(gè)寫(xiě)法是兼容各個(gè)瀏覽器,在Firefox瀏覽器中,事件綁定的函數(shù)獲取事件本身,是通過(guò)函數(shù)中傳入的,而IE等瀏覽器中,則可以通過(guò)window.event或者event的方式來(lái)獲取函數(shù)本身。

touchstart和click事件沖突解決: 去掉touchstart,touchmove和touchend事件中的e.preventDefault(); 它會(huì)阻止后面事件的觸發(fā);但去掉preventDefault事件會(huì)有問(wèn)題,在微信網(wǎng)頁(yè)中打開(kāi)這個(gè)網(wǎng)頁(yè),向下滑動(dòng)時(shí)會(huì)觸發(fā)微信的下拉事件,但是在App中應(yīng)用這組件就不會(huì)有這個(gè)問(wèn)題。有一個(gè)解決微信網(wǎng)頁(yè)中,手指向下滑動(dòng)觸發(fā)了微信的下拉刷新事件的方法,就是使用setTimeout。

setTimeout(() => {e.preventDefault(); }, ?200);

這樣子可以在click事件發(fā)生后,再阻止之后的默認(rèn)事件的觸發(fā)。

滾動(dòng)事件:滾動(dòng)事件是在touchmove和touchend中觸發(fā)的,面板的上滑事件和滾動(dòng)事件不同時(shí)進(jìn)行。

上滑時(shí),判斷面板狀態(tài),如果處于top狀態(tài),則觸發(fā)scroll事件,手指離開(kāi)面板時(shí),仍是scroll事件;如果是處于normal狀態(tài),則是上滑面板,手指離開(kāi)面板時(shí),設(shè)置面板為top狀態(tài),并設(shè)置內(nèi)容的滾動(dòng)條可見(jiàn);初始面板上滑到頂部時(shí),第二次上滑面板則會(huì)觸滾動(dòng)條,內(nèi)容可滾動(dòng);

下滑時(shí),判斷是否處于top狀態(tài),如果處于top狀態(tài),當(dāng)內(nèi)容區(qū)的scrollTop大于0,且手指初始位置位于內(nèi)容區(qū),那么就觸發(fā)滾動(dòng),否則觸發(fā)面板下滑;當(dāng)處于normal狀態(tài)時(shí),下滑的話,可以采用不觸發(fā)任何事件,或者可以下滑,但手指離開(kāi)屏幕時(shí),回歸到默認(rèn)位置,這里使用了后者的做法。

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Vuex實(shí)現(xiàn)數(shù)據(jù)共享的方法

    Vuex實(shí)現(xiàn)數(shù)據(jù)共享的方法

    Vuex 是一個(gè)專為 Vue.js 應(yīng)用程序開(kāi)發(fā)的狀態(tài)管理模式。這篇文章主要介紹了Vuex實(shí)現(xiàn)數(shù)據(jù)共享的方法,需要的朋友可以參考下
    2019-12-12
  • vue3獲取當(dāng)前路由地址

    vue3獲取當(dāng)前路由地址

    本文詳細(xì)講解了vue3獲取當(dāng)前路由地址的方法,對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-01-01
  • Vue 解決通過(guò)this.$refs來(lái)獲取DOM或者組件報(bào)錯(cuò)問(wèn)題

    Vue 解決通過(guò)this.$refs來(lái)獲取DOM或者組件報(bào)錯(cuò)問(wèn)題

    這篇文章主要介紹了Vue 解決通過(guò)this.$refs來(lái)獲取DOM或者組件報(bào)錯(cuò)問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-07-07
  • 解決vue單頁(yè)路由跳轉(zhuǎn)后scrollTop的問(wèn)題

    解決vue單頁(yè)路由跳轉(zhuǎn)后scrollTop的問(wèn)題

    今天小編就為大家分享一篇解決vue單頁(yè)路由跳轉(zhuǎn)后scrollTop的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09
  • Vue中的Object.defineProperty全面理解

    Vue中的Object.defineProperty全面理解

    這篇文章主要介紹了Vue中的Object.defineProperty全面理解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-04-04
  • Vue標(biāo)簽屬性動(dòng)態(tài)傳參并拼接字符串的操作方法

    Vue標(biāo)簽屬性動(dòng)態(tài)傳參并拼接字符串的操作方法

    這篇文章主要介紹了Vue標(biāo)簽屬性動(dòng)態(tài)傳參并拼接字符串的操作方法,我們需要根據(jù)傳入值的類型,在placeholder屬性賦值"請(qǐng)輸入長(zhǎng)度",“請(qǐng)輸入寬度”,"請(qǐng)輸入厚度"等提示字符,本文通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友參考下吧
    2023-11-11
  • vue如何設(shè)置定時(shí)器和清理定時(shí)器

    vue如何設(shè)置定時(shí)器和清理定時(shí)器

    這篇文章主要介紹了vue如何設(shè)置定時(shí)器和清理定時(shí)器,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-05-05
  • 通過(guò)vue-cropper選取本地圖片自定義裁切圖片比例

    通過(guò)vue-cropper選取本地圖片自定義裁切圖片比例

    這篇文章主要介紹了Vue選取本地圖片,自定義裁切圖片比例?vue-cropper,本文分步驟結(jié)合實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-07-07
  • 解決Vue2?axios發(fā)請(qǐng)求報(bào)400錯(cuò)誤"Error:?Request?failed?with?status?code?400"

    解決Vue2?axios發(fā)請(qǐng)求報(bào)400錯(cuò)誤"Error:?Request?failed?with?s

    這篇文章主要給大家介紹了關(guān)于如何解決Vue2?axios發(fā)請(qǐng)求報(bào)400錯(cuò)誤"Error:?Request?failed?with?status?code?400"的相關(guān)資料,在Vue應(yīng)用程序中我們通常會(huì)使用axios作為網(wǎng)絡(luò)請(qǐng)求庫(kù),需要的朋友可以參考下
    2023-07-07
  • Vue中進(jìn)行數(shù)據(jù)緩存的使用示例

    Vue中進(jìn)行數(shù)據(jù)緩存的使用示例

    數(shù)據(jù)緩存可以提高應(yīng)用程序的性能,減少網(wǎng)絡(luò)請(qǐng)求,提高用戶體驗(yàn),在本文中,我們介紹了Vue中如何進(jìn)行數(shù)據(jù)緩存,并提供了一些示例代碼,具有一定的參考價(jià)值,感興趣的可以了解一下
    2023-09-09

最新評(píng)論