中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

做資源網(wǎng)站需要什么seo優(yōu)化關(guān)鍵詞0

做資源網(wǎng)站需要什么,seo優(yōu)化關(guān)鍵詞0,簡道云crm,二級目錄 wordpress 偽靜態(tài)<Teleport></Teleport> 作用目的&#xff1a; 用于將指定的組件或者元素傳送到指定的位置&#xff1b; 通常是自定義的全局通用彈窗&#xff0c;綁定到 body 上&#xff0c;而不是在當(dāng)前元素上面&#xff1b; 使用方法&#xff1a; 接收兩個參數(shù) to: 要將目標(biāo)傳…
<Teleport></Teleport>  

作用目的:

用于將指定的組件或者元素傳送到指定的位置;
通常是自定義的全局通用彈窗,綁定到 body 上,而不是在當(dāng)前元素上面;

使用方法:

接收兩個參數(shù)
to: 要將目標(biāo)傳到的位置; 可以是指定的元素、class、id
disabled: 是否禁止將目標(biāo)傳送到指定位置;Boolean

比如:

<Teleport 
to="body"
disabled="true"
></Teleport>

而為什么要使用teleport 內(nèi)置組件呢?

比如:有這樣一個需求,我們需要一個盒子順時針旋轉(zhuǎn) 45度;而這個盒子同時是一個彈窗的父級組件,并且這個盒子可以打開改彈窗;

父組件:

<template>
<div class="my-built-in"><!-- 內(nèi)置組件 --><div class="other-place" @click="handleOpen">其他dom位置<TelDialog :isShowTel="isShowTel":telCon="telCon" @onCloseDialog="handleClose"></TelDialog></div>
</div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import TelDialog from './components/telDialog.vue'
const isShowTel = ref(false)
const telCon = ref('This is a Teleport component.')
const handleClose = () => {isShowTel.value = false
}
const handleOpen = () => {isShowTel.value = true
}
</script>
<style lang='scss' scoped>
.my-built-in{position: relative;width: 100px;height: 100px;background-color: #00ff00;left: 200px;transform: rotate(45deg);
}</style>

彈窗組件:

<template><div class="my-tel-container" v-if="props.isShowTel"><div class="my-tel-title">Teleport 彈窗</div><div class="my-tel-content">{{ props.telCon }}</div><div class="my-tel-foot"><el-button type="primary" class="close-btn" @click="handleClose">關(guān)閉teleport 彈窗</el-button></div></div>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps({isShowTel:{type: Boolean,default: false,},telCon: {type: String,default: ''}
})
const emits = defineEmits(['onCloseDialog'])
const handleClose = () => {emits('onCloseDialog')
}
</script>
<style lang='scss' scoped>
.my-tel-container{position: fixed;top:50%;left: 50%;width: 440px;height: auto;background-color: aqua;box-shadow: 0 2px 4px 0 rgba(0,0,0, .3);box-sizing: border-box;padding: 0 16px 16px;.my-tel-title{width: 100%;height: 46px;text-align: center;line-height: 46px;font-size: 16px;color: #333;}.my-tel-content{width: 100%;height: 200px;}.my-tel-foot{width: 100%;height: 46px;display: flex;justify-content: right;align-content: center;}
}
</style>

我們會發(fā)現(xiàn)寫好之后在沒有使用teleport 組件的情況下 彈窗也跟著旋轉(zhuǎn)了45度,這并不是我們想要的;為什么會出現(xiàn)這種情況呢?
如圖:
請?zhí)砑訄D片描述

我們需要的是即使父組件發(fā)上了旋轉(zhuǎn) 位移等,彈窗依然是位于瀏覽器的正中央;
此時我們就可以通過 <Teleport></Teleport> 組件來將彈窗組件實(shí)際渲染的位置更改到 body 上;但是這樣并不影響 組件直接的通訊;

更改父組件為:

<template>
<div class="my-built-in"><!-- 內(nèi)置組件 --><div class="other-place" @click="handleOpen">其他dom位置<!-- **只需要添加 Teleport 組件即可,disabled 接收一個布爾值,默認(rèn)是falsetrue代表不傳送到指定位置 body上** --><Teleport to="body" :disabled="false"><TelDialog :isShowTel="isShowTel":telCon="telCon" @onCloseDialog="handleClose"></TelDialog></Teleport></div>
</div>
</template>

請?zhí)砑訄D片描述

注意事項(xiàng):

a、在使用teleport 組件時,需要確保傳送的位置dom已經(jīng)渲染完成,即to的位置dom已完成渲染,否則將無法實(shí)現(xiàn)傳送;
b、同時可以通過給disabled 動態(tài)傳入一個Boolean 值,來控制是否要將元素或dom傳送到指定的位置;

http://www.risenshineclean.com/news/2685.html

相關(guān)文章:

  • 深圳建工是國企還是私企武漢seo公司哪家好
  • 尋找做網(wǎng)站的廣告網(wǎng)站策劃方案
  • 幫你省網(wǎng)站怎么做優(yōu)秀的軟文廣告案例
  • 有贊商城官網(wǎng)登錄旺道seo網(wǎng)站優(yōu)化大師
  • 常平網(wǎng)站仿做百度手機(jī)衛(wèi)士
  • 網(wǎng)站優(yōu)化網(wǎng)千鋒教育培訓(xùn)機(jī)構(gòu)怎么樣
  • 做色情網(wǎng)站多久會被抓網(wǎng)絡(luò)營銷服務(wù)
  • 泉州市住房和城鄉(xiāng)建設(shè)部網(wǎng)站南寧網(wǎng)站優(yōu)化公司電話
  • 自制游戲軟件seo怎樣
  • 網(wǎng)站做維恩圖公司網(wǎng)站制作教程
  • 合肥軟件外包公司關(guān)鍵詞優(yōu)化排名查詢
  • 南寧微信網(wǎng)站制作周口網(wǎng)絡(luò)推廣哪家好
  • 做網(wǎng)站優(yōu)化要多少錢廣州網(wǎng)絡(luò)seo優(yōu)化
  • 網(wǎng)站名字大全有哪些鄭州網(wǎng)站優(yōu)化外包
  • 網(wǎng)站建設(shè)微信商城多少錢病毒式營銷案例
  • wordpress摘要添加省略號鄂州網(wǎng)站seo
  • 網(wǎng)站的收費(fèi)標(biāo)準(zhǔn)品牌運(yùn)營策劃
  • 建設(shè)網(wǎng)站怎么掙錢廣東網(wǎng)約車漲價
  • 山東自助seo建站商丘seo外包
  • 卡地亞手表官方網(wǎng)站查詢上海seo優(yōu)化服務(wù)公司
  • 展示型企業(yè)網(wǎng)站有哪些推廣普通話黑板報(bào)
  • 外包做網(wǎng)站要十幾萬泉州排名推廣
  • 為什么做網(wǎng)站推廣站長域名查詢工具
  • 北京網(wǎng)站手機(jī)站建設(shè)公司電話號碼上海牛巨微seo
  • 開源網(wǎng)站建設(shè)網(wǎng)站alexa排名
  • 阿里云網(wǎng)站怎么備案域名網(wǎng)絡(luò)營銷戰(zhàn)略
  • 個人網(wǎng)站建設(shè)網(wǎng)站一個完整的營銷策劃方案范文
  • 網(wǎng)站開發(fā)與維護(hù)的內(nèi)容百度seo搜索引擎優(yōu)化
  • 網(wǎng)站線框圖怎樣做萬網(wǎng)官網(wǎng)
  • 常州制作網(wǎng)站信息百度指數(shù)搜索指數(shù)的數(shù)據(jù)來源