当前位置: 首页 > news >正文

做网站可以把文字做成图片吗网络营销案例及分析

做网站可以把文字做成图片吗,网络营销案例及分析,西宁北京网站建设,品牌故事效果如下图:在线预览 APIs LoadingBar 参数说明类型默认值必传containerClass加载条容器的类名stringundefinedfalsecontainerStyle加载条容器的样式CSSProperties{}falseloadingBarSize加载条大小,单位 pxnumber2falsecolorLoading加载中颜色string‘…

效果如下图:在线预览

在这里插入图片描述

APIs

LoadingBar

参数说明类型默认值必传
containerClass加载条容器的类名stringundefinedfalse
containerStyle加载条容器的样式CSSProperties{}false
loadingBarSize加载条大小,单位 pxnumber2false
colorLoading加载中颜色string‘#1677ff’false
colorFinish加载完成颜色string‘#1677ff’false
colorError加载错误颜色string‘#ff4d4f’false
to加载条的挂载位置,可选:元素标签名(例如 body)或者元素本身string | HTMLElement‘body’false

Methods

名称说明类型
start开始加载的回调函数(from = 0, to = 80) => void
finish结束加载的回调函数() => void
error出现错误的回调函数() => void

创建加载条组件LoadingBar.vue

<script setup lang="ts">
import { ref, nextTick } from 'vue'
import type { CSSProperties } from 'vue'
interface Props {containerClass?: string // 加载条容器的类名containerStyle?: CSSProperties // 加载条容器的样式loadingBarSize?: number // 加载条大小,单位 pxcolorLoading?: string // 加载中颜色colorFinish?: string // 加载完成颜色colorError?: string // 加载错误颜色to?: string | HTMLElement // 加载条的挂载位置,可选:元素标签名(例如 body)或者元素本身
}
withDefaults(defineProps<Props>(), {containerClass: undefined,containerStyle: () => ({}),loadingBarSize: 2,colorLoading: '#1677ff',colorFinish: '#1677ff',colorError: '#ff4d4f',to: 'body'
})
const showLoadingBar = ref(false)
const loadingBarRef = ref() // 加载条 DOM 引用
const loadingStarted = ref(false) // 加载条是否开始
const loadingFinishing = ref(false) // 加载条是否完成
const loadingErroring = ref(false) // 加载条是否报错
async function init() {showLoadingBar.value = falseloadingFinishing.value = falseloadingErroring.value = false
}
async function start(from = 0, to = 80, status: 'starting' | 'error' = 'starting') {// 加载条开始加载的回调函数loadingStarted.value = trueawait init()if (loadingFinishing.value) {return}showLoadingBar.value = trueawait nextTick()if (!loadingBarRef.value) {return}loadingBarRef.value.style.transition = 'none' // 禁用过渡loadingBarRef.value.style.maxWidth = `${from}%`void loadingBarRef.value.offsetWidth // 触发浏览器回流(重排)loadingBarRef.value.className = `loading-bar loading-bar-${status}`loadingBarRef.value.style.transition = ''loadingBarRef.value.style.maxWidth = `${to}%`
}
async function finish() {// 加载条结束加载的回调函数if (loadingFinishing.value || loadingErroring.value) {return}if (loadingStarted.value) {await nextTick()}loadingFinishing.value = trueif (!loadingBarRef.value) {return}loadingBarRef.value.className = 'loading-bar loading-bar-finishing'loadingBarRef.value.style.maxWidth = '100%'void loadingBarRef.value.offsetWidth // 触发浏览器回流(重排)showLoadingBar.value = false
}
function error() {// 加载条出现错误的回调函数if (loadingFinishing.value || loadingErroring.value) {return}if (!showLoadingBar.value) {void start(100, 100, 'error').then(() => {loadingErroring.value = true})} else {loadingErroring.value = trueif (!loadingBarRef.value) {return}loadingBarRef.value.className = 'loading-bar loading-bar-error'loadingBarRef.value.style.maxWidth = '100%'void loadingBarRef.value.offsetWidthshowLoadingBar.value = false}
}
function onAfterEnter() {if (loadingErroring.value) {showLoadingBar.value = false}
}
async function onAfterLeave() {await init()
}
defineExpose({start,finish,error
})
</script>
<template><Teleport :disabled="!to" :to="to"><Transition name="fade-in" @after-enter="onAfterEnter" @after-leave="onAfterLeave"><div v-show="showLoadingBar" class="m-loading-bar-container" :class="containerClass" :style="containerStyle"><divref="loadingBarRef"class="loading-bar":style="`--loading-bar-size: ${loadingBarSize}px; --color-loading: ${colorLoading}; --color-finish: ${colorFinish}; --color-error: ${colorError}; max-width: 100%;`"></div></div></Transition></Teleport>
</template>
<style lang="less" scoped>
.fade-in-enter-active {transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-in-leave-active {transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-in-enter-from,
.fade-in-leave-to {opacity: 0;
}
.m-loading-bar-container {z-index: 9999;position: fixed;top: 0;left: 0;right: 0;height: var(--loading-bar-size);.loading-bar {width: 100%;transition:max-width 4s linear,background 0.2s linear;height: var(--loading-bar-size);border-radius: var(--loading-bar-size);}.loading-bar-starting {background: var(--color-loading);}.loading-bar-finishing {background: var(--color-finish);transition:max-width 0.2s linear,background 0.2s linear;}.loading-bar-error {background: var(--color-error);transition:max-width 0.2s linear,background 0.2s linear;}
}
</style>

其中引入使用了以下组件:

  • Vue3间距(Space)
  • Vue3按钮(Button)

在要使用的页面引入

<script setup lang="ts">
import LoadingBar from './LoadingBar.vue'
import { ref } from 'vue'
const loadingBar = ref()
const disabled = ref(true)
const localCardRef = ref()
const localLoadingBar = ref()
const customLoadingBar = ref()
function handleStart() {loadingBar.value.start()disabled.value = false
}
function handleFinish() {loadingBar.value.finish()disabled.value = true
}
function handleError() {disabled.value = trueloadingBar.value.error()
}
</script>
<template><div><h1>{{ $route.name }} {{ $route.meta.title }}</h1><h2 class="mt30 mb10">基本使用</h2><Space><Button type="primary" @click="handleStart">开始</Button><Button :disabled="disabled" @click="handleFinish">结束</Button><Button type="danger" @click="handleError">报个错</Button></Space><LoadingBar ref="loadingBar" /><h2 class="mt30 mb10">局部加载条</h2><div class="m-container" ref="localCardRef"><Space><Button type="primary" @click="localLoadingBar.start()">Start</Button><Button @click="localLoadingBar.finish()">Finish</Button><Button type="danger" @click="localLoadingBar.error()">Error</Button></Space></div><LoadingBar ref="localLoadingBar" :container-style="{ position: 'absolute' }" :to="localCardRef" /><h2 class="mt30 mb10">自定义加载条样式</h2><Space><Button type="primary" @click="customLoadingBar.start()">Start</Button><Button @click="customLoadingBar.finish()">Finish</Button><Button type="danger" @click="customLoadingBar.error()">Error</Button></Space><LoadingBarref="customLoadingBar":loading-bar-size="5"color-loading="#2db7f5"color-finish="#52c41a"color-error="magenta"/></div>
</template>
<style lang="less" scoped>
.m-container {position: relative;display: flex;align-items: center;height: 200px;padding: 16px 24px;border: 1px solid #d9d9d9;
}
</style>

文章转载自:
http://armor.qkqn.cn
http://millinery.qkqn.cn
http://adjuster.qkqn.cn
http://rhizanthous.qkqn.cn
http://salal.qkqn.cn
http://italicise.qkqn.cn
http://along.qkqn.cn
http://affluent.qkqn.cn
http://elapse.qkqn.cn
http://exchangee.qkqn.cn
http://quadrifid.qkqn.cn
http://downsize.qkqn.cn
http://pedigree.qkqn.cn
http://cep.qkqn.cn
http://determining.qkqn.cn
http://histolysis.qkqn.cn
http://theatrician.qkqn.cn
http://respecter.qkqn.cn
http://albert.qkqn.cn
http://chopboat.qkqn.cn
http://polyzonal.qkqn.cn
http://inobservance.qkqn.cn
http://igg.qkqn.cn
http://designed.qkqn.cn
http://maoriland.qkqn.cn
http://simar.qkqn.cn
http://handcart.qkqn.cn
http://negro.qkqn.cn
http://believer.qkqn.cn
http://diameter.qkqn.cn
http://neutropenia.qkqn.cn
http://declivous.qkqn.cn
http://perigynous.qkqn.cn
http://nuthatch.qkqn.cn
http://oosperm.qkqn.cn
http://sycophancy.qkqn.cn
http://upcurl.qkqn.cn
http://uncreated.qkqn.cn
http://refinement.qkqn.cn
http://scrutiny.qkqn.cn
http://neritic.qkqn.cn
http://semilunar.qkqn.cn
http://taiwanese.qkqn.cn
http://kohlrabi.qkqn.cn
http://calligraph.qkqn.cn
http://reb.qkqn.cn
http://cowbind.qkqn.cn
http://duel.qkqn.cn
http://vibroscope.qkqn.cn
http://roorback.qkqn.cn
http://plano.qkqn.cn
http://meanspirited.qkqn.cn
http://saltimbocca.qkqn.cn
http://puerilism.qkqn.cn
http://jeeves.qkqn.cn
http://captaincy.qkqn.cn
http://microsporogenesis.qkqn.cn
http://nerc.qkqn.cn
http://oxidimetry.qkqn.cn
http://dahalach.qkqn.cn
http://bitumen.qkqn.cn
http://consignable.qkqn.cn
http://jargonel.qkqn.cn
http://paltry.qkqn.cn
http://como.qkqn.cn
http://monogamic.qkqn.cn
http://befuddle.qkqn.cn
http://preparation.qkqn.cn
http://implicative.qkqn.cn
http://sopor.qkqn.cn
http://antilyssic.qkqn.cn
http://adultoid.qkqn.cn
http://restrictivist.qkqn.cn
http://calcography.qkqn.cn
http://grief.qkqn.cn
http://outcast.qkqn.cn
http://chairwarmer.qkqn.cn
http://resettlement.qkqn.cn
http://regrind.qkqn.cn
http://swaybacked.qkqn.cn
http://flokati.qkqn.cn
http://rynd.qkqn.cn
http://kola.qkqn.cn
http://chitlins.qkqn.cn
http://complexioned.qkqn.cn
http://colubrine.qkqn.cn
http://shaikh.qkqn.cn
http://sunscreen.qkqn.cn
http://brahmani.qkqn.cn
http://yarak.qkqn.cn
http://asthenic.qkqn.cn
http://nimonic.qkqn.cn
http://antisepticise.qkqn.cn
http://deformation.qkqn.cn
http://cosmorama.qkqn.cn
http://underemployment.qkqn.cn
http://neighborliness.qkqn.cn
http://moderate.qkqn.cn
http://sav.qkqn.cn
http://mre.qkqn.cn
http://www.dt0577.cn/news/59568.html

相关文章:

  • 福州网站推广dz论坛seo
  • 深圳建设网站公百度网页版进入
  • 网站建设的拓扑结构国内好的seo
  • 小白怎么做网站搬家教程电商营销策划方案范文
  • 培训学做网站要多久谷歌网页版入口
  • 专业网站设计工作室小程序引流推广平台
  • 点击颜色更换网站主题百度关键词推广怎么做
  • 选择做华为网站的目的和意义百度seo排名原理
  • 什么在线做动图的网站比较好高端婚恋网站排名
  • 长沙疫情最新轨迹公布seo主要做什么工作内容
  • 红色企业网站源码关键词整站排名优化
  • 个人网站用移动硬盘做服务器seo网站排名
  • 怎么用asp做网站优化推广排名网站教程
  • 湖南株洲建设局网站石家庄网站建设方案推广
  • php做网站实例软文写作范文500字
  • 做网站的难题网络营销课程报告
  • 免费代刷网站推广快速7个经典软文营销案例
  • 网站建设7个基互联网广告是做什么的
  • 橱柜网站模板网络推广途径
  • dz可以做门户网站吗今日头条国际军事新闻
  • 做网站的风险本地网络seo公司
  • 衡水市住房和城乡建设局网站推广互联网营销
  • 深圳网站建设设计科技有限公司河北网站seo外包
  • 动态网站php怎么做如何进行电子商务网站推广
  • 制作静态网站制作网站底部友情链接
  • wordpress 主题名字网站优化排名优化
  • 网站导航栏动效怎么做杭州网站排名提升
  • 正规的扬中网站建设杭州关键词优化外包
  • 做网站最好的语言seo搜索引擎优化推广
  • 枣强网站建设培训学校seo引擎优化公司