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

如何给自家网站做关键词优化用科讯cms做网站的步骤

如何给自家网站做关键词优化,用科讯cms做网站的步骤,网站建设上海网站建设,西安是哪个省属于哪个市五、UniAPP 常用组件简介 uni-app 为开发者提供了一系列基础组件,类似 HTML 里的基础标签元素,但 uni-app 的组件与 HTML 不同,而是与小程序相同,更适合手机端使用。 虽然不推荐使用 HTML 标签,但实际上如果开发者写了…

五、UniAPP 常用组件简介

uni-app 为开发者提供了一系列基础组件,类似 HTML 里的基础标签元素,但 uni-app 的组件与 HTML 不同,而是与小程序相同,更适合手机端使用。

虽然不推荐使用 HTML 标签,但实际上如果开发者写了div等标签,在编译到非H5平台时也会被编译器转换为 view 标签,类似的还有 spantextanavigator等,包括 css 里的元素选择器也会转,但为了管理方便、策略统一,新写代码时仍然建议使用view等组件。

开发者可以通过组合这些基础组件进行快速开发, 基于内置的基础组件,可以开发各种扩展组件,组件规范与vue组件相同。

案例:知心姐姐布局实现

<template><view class="container"><!-- 聊天列表 --><view class="chat-body"><block v-for="(item, index) in chatList" :key="index"><view class="chat-one" v-if="!item.isMe"><image class="chat-face" src="@/static/faces/head1.jpeg" /><view class="chat-box"><view class="chat-sender">知心姐姐</view><view class="chat-content" v-if="item.type === 'txt'">{{item.content}}</view><image class="chat-img" v-if="item.type === 'img'" :src="item.content" mode='widthFix' /></view></view><view v-else class="chat-one chat-one-mine"><view class="chat-box"><view class="chat-content" v-if="item.type === 'txt'">{{item.content}}</view><image class="chat-img" v-if="item.type === 'img'" :src="item.content" mode='widthFix' /></view><image class="chat-face" src="@/static/faces/head2.jpeg" /></view></block></view><!-- 聊天输入 --><view class="chat-footer"><input class="msg-input" type="text" cursor-spacing="16" v-model="myInput"/><image class="img-chose" src="@/static/img.png" @click="choseImgAndSend"/><view class="send-btn" @click="sendMsg">发送</view></view></view>
</template>

css样式


<style lang="scss" scoped>.container {background-color: #f1f1f1;min-height: 100vh;}.chat-body {padding-bottom: 178upx;.chat-time {text-align: center;color: #888;padding: 40upx 0 0;}.chat-one {display: flex;flex-direction: row;flex-wrap: wrap;justify-content: flex-start;align-items: flex-start;padding: 20upx 0;}.chat-one-begin {padding: 40upx 0 0;}.chat-one-mine {justify-content: flex-end;}.chat-face {width: 84upx;height: 84upx;border-radius: 10upx;margin-left: 40upx;}.chat-one-mine .chat-face {margin-left: 0;margin-right: 40upx;}.chat-box {max-width: calc(100% - 290upx);margin-left: 20upx;font-size: 30upx;}.chat-one-mine .chat-box {margin-right: 20upx;}.chat-sender {color: #888;font-size: 28upx;margin-top: -8upx;margin-bottom: 10upx;}.chat-content {background-color: #fff;border-radius: 5px;padding: 10px;.micon {margin-right: 20upx;color: #666;}}.chat-img {float: left;max-width: 60%;border-radius: 5px;}.chat-one-mine .chat-img {float: right;}}.chat-footer {width: 670upx;padding: 0 40upx;height: 120upx;position: fixed;bottom: 0;left: 0;background-color: #f1f1f1;display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-between;align-items: center;align-content: center;border-top: 1upx solid #ddd;.msg-input {background-color: #fff;width: calc(100% - 300upx);height: 70upx;line-height: 70upx;font-size: 30upx;border-radius: 10upx;padding: 0 20upx;}.img-chose{height: 70upx;width: 70upx;}.send-btn {height: 60upx;line-height: 60upx;width: 120upx;text-align: center;background-color: green;color: #FFFFFF;border-radius: 12upx;}}
</style>

六、UniAPP 常用 API 简介

uni-app的 js 代码,h5 端运行于浏览器中,非 h5 端 Android 平台运行在 v8 引擎中,iOS 平台运行在 iOS 自带的 jscore 引擎中。所以,uni-app的 jsAPI 由标准 ECMAScript 的 js API 和 uni 扩展 API 这两部分组成。

ECMAScript 由 Ecma 国际管理,是基础 js 语法。浏览器基于标准 js 扩充了window、document 等 js API;Node.js 基于标准 js 扩充了 fs 等模块;小程序也基于标准 js 扩展了各种 wx.xx、my.xx、swan.xx 的 API。

标准 ecmascript 的 API 非常多,比如:console、settimeout等等。

非 H5 端,虽然不支持 window、document、navigator 等浏览器的 js API,但也支持标准 ECMAScript。

开发者不要把浏览器里的 js 等价于标准 js。

所以 uni-app 的非 H5 端,一样支持标准 js,支持 if、for 等语法,支持字符串、数组、时间等变量及各种处理方法,仅仅是不支持浏览器专用对象。


<script>export default {data() {return {// 保存聊天的内容chatList:[{isMe: false,type: 'txt',content: '你好,我是可爱的知心姐姐,请问你想和我聊什么呢?'},{isMe: false,type: 'img',content: '/static/image/1.jpeg'},{isMe: true,type: 'txt',content: '哇,你真漂亮'},{isMe: true,type: 'img',content: '/static/image/2.jpeg'}],myInput:''}},onShow(){if(!!uni.getStorageSync('chatList')){this.chatList = JSON.parse(uni.getStorageSync('chatList'))uni.pageScrollTo({scrollTop: 999999,duration: 0})}},methods:{choseImgAndSend(){uni.chooseImage({count: 1,sizeType: ['original', 'compressed'],sourceType: ['album', 'camera'],success: res => {console.log(res.tempFilePaths[0])let senMsg = {isMe: true,type: 'img',content: res.tempFilePaths[0]}this.chatList.push(senMsg)let resMsg = {isMe: false,type: 'img',content: res.tempFilePaths[0]}this.chatList.push(resMsg)uni.pageScrollTo({scrollTop: 999999,duration: 0})uni.setStorageSync('chatList', JSON.stringify(this.chatList))}})},sendMsg(){if(!this.myInput) returnlet senMsg = {isMe: true,type: 'txt',content: this.myInput}this.chatList.push(senMsg)let resMsg = {isMe: false,type: 'txt',content: this.myInput}this.chatList.push(resMsg)this.myInput = ''uni.pageScrollTo({scrollTop: 999999,duration: 0})uni.setStorageSync('chatList', JSON.stringify(this.chatList))}}}
</script>

效果展示

在这里插入图片描述

http://www.yayakq.cn/news/110328/

相关文章:

  • 台州自助建站在线咨询做外贸网站设计上需要注意什么
  • 东莞seo建站费用wordpress购物 app
  • 网站设计策划男女做爰视频网站
  • 英文网站怎么建个人建站步骤
  • 设计一个学院网站哈尔滨做网站搭建的
  • 深圳设计公司企业网站龙岗网站注册
  • 网站收录更新沈阳沈河区网站建设
  • 中英文网站后台网站域名申请之后如何做网站
  • 长春建设平台网站的公司哪家好廊坊百度推广网站设计
  • php 网站开发 pdf深圳专业建站平台
  • 100t空间 做网站怎么做网页站点
  • 制作网站视频教程做图片网站赚不赚钱
  • 广东深广东深圳网站建设服务泉州网络推广公司
  • google 网站收录济源市城乡建设局网站
  • 注册个人网站域名是com好还是net好软件开发项目验收报告
  • 泰安高新区建设局网站微信微商城怎么进入
  • 苏州营销型网站制作公司pos机网站模板
  • 手机做服务器搭网站手机版网站模板
  • 在线手机网站预览WORDPRESS自定义加载不出来
  • 可以搜索国外网站的搜索引擎上海企业网站
  • 云霄县建设局网站摄影网站设计与制作
  • 可以提供排版的网站河海大学土木专业类建设网站
  • 盐城亭湖区建设局网站龙岗-网站建设深圳信科
  • 网站建设优化公司哪家好公司邮箱从哪里登录
  • 常德网站制作建设怎么给老板提供网站建设资料
  • 烟台网站制作方案成都网站建设报价表
  • 自有服务器 建网站品牌网络推广公司
  • html网站怎么做的长沙英文网站建设公司
  • 自建网站该页无法显示ui培训设计学校
  • 网站建设合同需要缴纳印花税河南商都建设有限公司网站