uni-app快速导入自己需要的插件

简介: uni-app快速导入自己需要的插件

在uni-app中快速导入自己需要的插件


在uni-app的官网上;找到自己需要的插件;  


然后点击右侧顶部的【使用HX导入】这一步的前提是你必须要用自己的账好登录;


然后选择你要导入哪一个项目 然后就可以了


1425695-20200721170836862-328463595.png

1425695-20200721170844303-1680186686.png


插件


<template>
  <!-- 获取一个数组,结构为[{date:'时间',info:'内容内容'}] -->
  <!-- @click事件返回点击标签元素的索引值 第一项为0 -->
  <!--  
   在uni-app中快速导入自己需要的插件
   在uni-app的官网上;找到自己需要的插件; 
   然后点击右侧顶部的【使用HX导入】这一步的前提是你必须要用自己的账好登录;
   然后选择你要导入哪一个项目 然后就可以了
   -->
  <view class="bg">
    <view class="steps">
      <view class="steps_item" v-for="(i, index) in infoList">
        <view class="s_r">
          <view class="line" :style="{backgroundColor:index != 0?backgroundColor:'rgba(0,0,0,0)'}"></view>
          <view class="index" :style="{backgroundColor:backgroundColor,color:color}">
            {{ index + 1 }}
          </view>
          <view class="line" :style="{backgroundColor:index != infoList.length-1?backgroundColor:'rgba(0,0,0,0)'}"></view>
        </view>
        <view class="s_l">
          <view class="info_item" @tap="topage(index)">
            <text>{{ i.date }}</text>
            <view :style="{WebkitLineClamp:lineNum!=0?lineNum:''}">{{ i.info }}</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
  export default {
    name: 'YSteps',
    props: {
      infoList: {
        type: Array,
        default: []
      },
      color: {
        type: String,
        default: '#fff'
      },
      backgroundColor: {
        type: String,
        default: '#ff3838'
      },
      lineNum: {
        type: Number,
        default: 0
      }
    },
    data() {
      return {};
    },
    onLoad(e) {
      //获取列表
    },
    methods: {
      topage(e) {
        this.$emit('click', e);
      }
    }
  };
</script>
<style lang="scss" scoped>
  page {
    background-color: #f2f2f2;
  }
  .bg {
    margin: 20upx 0;
    background-color: #f2f2f2;
    display: flex;
  }
  .steps {
    display: flex;
    flex-direction: column;
    .steps_item {
      display: flex;
      .s_r {
        padding: 0 20rpx;
        display: flex;
        flex-direction: column;
        align-items: center;
        .line {
          flex: 1;
          width: 5rpx;
          background-color: #fff;
        }
        .index {
          width: 40rpx;
          height: 40rpx;
          font-size: 12px;
          text-align: center;
          line-height: 40rpx;
          border-radius: 50rpx;
        }
      }
      .s_l {
        display: flex;
        flex-direction: column;
        padding: 20rpx 0;
        .info_item {
          background-color: #FFFFFF;
          margin-right: 30upx;
          border-radius: 10upx;
          display: flex;
          flex-direction: column;
          justify-content: center;
          padding: 30upx;
          box-shadow: 0 10rpx 30rpx #ddd;
          width: 580rpx;
          text {
            font-size: 18px;
            font-weight: 500;
            color: rgba(51, 51, 51, 1);
            line-height: 25px;
          }
          view {
            font-size: 14px;
            font-weight: 400;
            color: rgba(102, 102, 102, 1);
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            flex-direction: column;
          }
        }
        .info_item:active {
          background-color: #f4f4f4;
        }
      }
    }
  }
  // .steps {
  //  display: flex;
  //  flex-direction: column;
  //  margin: 0 30upx;
  //  .steps_item {
  //    display: flex;
  //    align-items:center ;
  //    background-color: #fff;
  //    margin-top: 10rpx;
  //    .s_r {
  //      display: flex;
  //      flex-direction: column;
  //      align-items: center;
  //      height: 100%;
  //      background-color: #f3f;
  //      flex: 1;
  //      view {
  //        height: 100%;
  //        display: flex;
  //        flex: 1;
  //        height: 100%;
  //        width: 5upx;
  //      }
  //      text {
  //        display: flex;
  //        flex-direction: column;
  //        align-items: center;
  //        width: 40upx;
  //        line-height: 40upx;
  //        height: 40upx;
  //        border-radius: 50%;
  //        background-color: #ff3838;
  //        color: #ffffff;
  //        font-size: 10px;
  //      }
  //    }
  //  }
  // }
  // .info_list {
  //  display: flex;
  //  flex-direction: column;
  //  flex: 1;
  //  .info_item {
  //    background-color: #fff;
  //    height: 200upx;
  //    margin: 20upx 0;
  //    margin-right: 30upx;
  //    border-radius: 10upx;
  //    display: flex;
  //    flex-direction: column;
  //    justify-content: center;
  //    padding: 0 30upx;
  //    text {
  //      font-size: 18px;
  //      font-family: PingFangSC-Medium, PingFang SC;
  //      font-weight: 500;
  //      color: rgba(51, 51, 51, 1);
  //      line-height: 25px;
  //    }
  //    view {
  //      font-size: 14px;
  //      font-family: PingFangSC-Regular, PingFang SC;
  //      font-weight: 400;
  //      color: rgba(102, 102, 102, 1);
  //      line-height: 20px;
  //      overflow: hidden;
  //      text-overflow: ellipsis;
  //      display: -webkit-box;
  //      -webkit-line-clamp: 2;
  //      flex-direction: column;
  //    }
  //  }
  //  .info_item:active {
  //    opacity: 0.6;
  //  }
  // }
</style>


使用


<view style="background-color: #f2f2f2;padding-top: 100rpx;">
   <YSteps lineNum='0' color='#fff' backgroundColor='#000fff' :infoList='list'></YSteps>
</view>
import YSteps from '../../components/Y-Steps/Y-Steps.vue'
list: [
          {
            date: '2020-1-4',
            info: '我一次来到这个这个阅读网站'
          },
          {
            date: '2020-2-4',
            info: '我写下了自己的第一篇文章'
          },
          {
            date: '2020-3-4',
            info: '我的文章超阅读量过了10W'
          },
          {
            date: '2020-4-4',
            info: '我成为写作达人'
          },
],
components:{
      YSteps
}




相关文章
|
JSON JavaScript 前端开发
iOS小技能: 开发 uni-app 原生插件(支持iOS Extension)
术语:uni原生插件指的是将`原生开发的功能按照规范封装成插件包`,然后即可在 uni-app 前端项目中通过js调用原生能力。
1912 0
iOS小技能: 开发 uni-app 原生插件(支持iOS Extension)
|
5月前
|
IDE 开发工具 开发者
使用DevEcoStudio 开发、编译鸿蒙 NEXT_APP 以及使用中文插件
# 使用DevEcoStudio 开发、编译鸿蒙 NEXT_APP 以及使用中文插件 #鸿蒙开发工具 #DevEco Studio
497 1
|
5月前
|
XML 数据格式
美团抢单辅助器app,美团众包抢单辅助脚本,骑手自动抢高价单插件
这是一段关于美团骑手抢单辅助脚本的介绍。使用该脚本可设置最高与最低价格、延迟时间等参数,通过自动化检测和抢单功能帮助骑手提高收入。
|
存储 安全 网络安全
【应用服务 App Service】App Service证书导入,使用Key Vault中的证书
【应用服务 App Service】App Service证书导入,使用Key Vault中的证书
205 2
|
网络安全 数据安全/隐私保护
【Azure 应用服务】 在App Service中无法上传证书[Private Key Certificates (.pfx)],导入Azure Key Vault中的证书也无法成功
【Azure 应用服务】 在App Service中无法上传证书[Private Key Certificates (.pfx)],导入Azure Key Vault中的证书也无法成功
|
小程序 API
跨端技术问题之哪些形态可以通过getApp()获取全局App实例
跨端技术问题之哪些形态可以通过getApp()获取全局App实例
|
JSON 数据格式
3. 使用 VsCode 开发 uni-app 项目需要使用到的插件
3. 使用 VsCode 开发 uni-app 项目需要使用到的插件
789 0
【Hbuilder】Hbuilder 插件[App]云打包安装失败--已解决
【Hbuilder】Hbuilder 插件[App]云打包安装失败--已解决
708 0