vue
扬州的你
向大家学习
展开
-
vue注册组件
<template> <view> <scroll-view :scroll-into-view="'ss'+current" scroll-x="true" style="background-color: #007AFF;padding-top: 20px;"> <view class="tabs"> <text :id="'ss'+index" @click="chooseTab(index)" :class="{cur:cur原创 2021-05-05 21:05:22 · 75 阅读 · 0 评论 -
动态class写法
动态class写法<template> <view style="display: flex;justify-content: center;"> <image :class="{'animate__animated animate__slideInDown':showAi}" src="../../static/uni.png" mode="" style="width: 100px;height: 100px;"></image>原创 2021-05-03 23:42:54 · 438 阅读 · 0 评论 -
外部浏览器 解决跨域
外部浏览器 解决跨域项目的根目录中, 创建 vue.config.js// vue.config.jsmodule.exports = { devServer:{ proxy:{ // 所有请求的开头是 /api 的, 自动代理成 target 指定的路径 '/api':{ target: 'https://m.douyu.com/api', pathRewrite: { // 默认: 例如 /api/room/list, 代理会转化为: //原创 2021-04-29 22:44:44 · 580 阅读 · 0 评论 -
一个简单的实现“加载更多“的demo
<template> <view class=""> <uni-list> <uni-list-item v-for="(item,index) in data.list" :key="index" title=""> <view slot="header"> <image :src="item.roomSrc" style="width: 250rpx;height: 150rpx;" mode=""&g原创 2021-04-25 17:17:05 · 80 阅读 · 0 评论 -
前端的两种时间处理方法
两种时间处理方法1.js定义函数定义一个函数,将后台获取到的数据传入,time为获取到的时间//定义一个函数,将后台获取到的数据传入,time为获取到的时间transTime(time){ const date = new Date(time * 1) return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}` },uniapp中,card组件中,note代表时间,item.pubTime为后台的原创 2021-04-23 19:02:04 · 1095 阅读 · 0 评论 -
vue的axios两种导入方法
1.在main.js中设置(1)首先在npm中安装模块npm install vue-axios --save(2)安装成功后在main.js中引用``import Vue from ‘vue’import axios from ‘axios’Vue.prototype.$axios = axios //全局注册Vue.prototype.qs = qs**2.Vue.use()**(1)首先在npm中安装模块 npm install vue-axios --save (2原创 2021-04-17 22:33:43 · 7256 阅读 · 1 评论