Giter VIP home page Giter VIP logo

wechat-miniprogram / kbone-ui Goto Github PK

View Code? Open in Web Editor NEW
441.0 441.0 45.0 4.33 MB

kbone-ui 是一套能同时支持 小程序(kbone) 和 vue 框架开发的多端 UI 库(PS:新版 kbone-ui 已出炉并迁移到 kbone 主仓库,此仓库仅做旧版维护之用)

Home Page: https://wechat-miniprogram.github.io/kbone/docs/ui/intro/

License: MIT License

JavaScript 28.55% HTML 0.17% Vue 71.28%

kbone-ui's People

Contributors

baranwang avatar jimmyvv avatar juneandgreen avatar lastleaf avatar orziz avatar sgly avatar xuxingeren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kbone-ui's Issues

install error

npm install kbone-ui


 npm install kbone-ui     

                                                                                                                                                      ✹ ✭main 

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @typescript-eslint/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"*" from @typescript-eslint/[email protected]
npm ERR!   node_modules/@typescript-eslint/type-utils
npm ERR!     @typescript-eslint/type-utils@"5.36.2" from @typescript-eslint/[email protected]
npm ERR!     node_modules/@typescript-eslint/eslint-plugin
npm ERR!       dev @typescript-eslint/eslint-plugin@"^5.11.0" from the root project
npm ERR!   peer eslint@"^3.19.0 || ^4.5.0" from [email protected]
npm ERR!   node_modules/eslint-config-airbnb-base
npm ERR!     dev eslint-config-airbnb-base@"^11.3.0" from the root project
npm ERR!   4 more (eslint-plugin-import, eslint-plugin-vue, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   dev @typescript-eslint/eslint-plugin@"^5.11.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/[email protected]
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR!     dev @typescript-eslint/eslint-plugin@"^5.11.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/wukt/.npm/eresolve-report.txt for a full report

使用 kbone-ui ,打小程序包,报错

在 main.mp.js 中 import 'kbone-ui/lib/weui/weui.css'
npm run mp 时,报
optimization OptimizeCssAssetsWebpackPluginTypeError: Cannot read property 'toFixed' of undefined

WeUI 报错

window.Vue.use(WeUI) 这个WeUI 不会报错吗,看代码依赖没引入吧

github版不支持npm link 引用

经排查,是 .vue 引入 '@utils/utils' 的锅,应该是找不到这个库。虽然webpack里面有配置,但是npm link 根本不会读webpack

部分组件样式 h5 和小程序不一致,缺少从底部弹出的 picker 组件

1. 目前发现 radiocheckbox 样式 h5 和小程序中表现不一致

  • h5 中的 checkbox 和 radio 组件

image

  • 小程序中的 checkbox

image

  • 小程序中的 radio

image

2. picker 组件目前只有 picker-viewpicker-view-column,没有小程序中从底部弹出,带有黑色蒙板和取消确定按钮的 picker 组件

image

不知道目前有抹平这些差异的计划吗?希望能够参与进来

swiper is not working on web landscape view with MacBook trackpad

screen recording:

swiper.mov.zip

example page:

swiper-on-desktop.zip

home page source code:

Index.vue.zip

vue 2.6.11, kbone-ui 0.6.2, tested on macbook pro 13-inch Chrome 79.0.3945.79

<template>
  <div class='content'>
    <k-swiper class='swiper-wrapper' indicator-dots=true>
      <k-swiper-item>
        <img src='https://loremflickr.com/320/240?lock=1'>
      </k-swiper-item>
      <k-swiper-item>
        <img src='https://loremflickr.com/320/240?lock=2'>
      </k-swiper-item>
      <k-swiper-item>
        <img src='https://loremflickr.com/320/240?lock=3'>
      </k-swiper-item>
    </k-swiper>
  </div>
</template>

<script>
import Vue from 'vue'
import { KSwiper, KSwiperItem } from 'kbone-ui'

export default Vue.extend({
  name: 'Home',
  components: {
    KSwiper,
    KSwiperItem,
  },
  created() {

  },
  methods: {

  },
})
</script>

<style lang="less">
.content {
  display: flex;
  width: 100%;
  margin-top: 20px;
  justify-content: center;
  justify-items: center;

  .swiper-wrapper {
    width: 320px;
    height: 240px;
    .weui-swiper-item {
      width: 320px;
      height: 240px;
    }
    img {
      width: 320px;
      height: 240px;
    }
  }
}

</style>

希望可以针对css样式支持基于 ES modules 的 tree shaking

我看 https://wechat-miniprogram.github.io/kbone/docs/ui/intro/quickstart.html 文档里面按需引入所需组件的时候,还需要要么引入所有的样式(即使只用到了其中一两个组件,希望可以仅仅引入所需组件的样式),另外按需引入的时候还需要单独引入样式(目前是所有的样式),如果按需引入较多组件,又或者按需引入的组件经常变化,需要同时维护js和css的引入,有些不方便。

可以参考 antd ( https://ant.design/docs/react/getting-started-cn#%E6%8C%89%E9%9C%80%E5%8A%A0%E8%BD%BD ) 、vuetify ( https://vuetifyjs.com/en/features/treeshaking/#required-styles ) 等实现方式,通过 loader ( https://github.com/ant-design/babel-plugin-import, https://github.com/vuetifyjs/vuetify-loader ) 插件,代码中只需要引入js组件,相关联的css就可以自动引入,可以非常智能的针对按需引入或者全部引入。

KPickerView on change not working in mp mode

vue 2.6.11, kbone-ui 0.6.2

<template>
  <div class="cnt">
    <Header></Header>
    <div>
      <KPickerView
        indicator-style="height: 50px;"
        style="width: 100%; height: 300px;"
        @change="changeIndex"
      >
        <KPickerViewColumn>
          <KView
            v-for="(item,index) in singleData"
            style="line-height: 50px;"
            :key="index"
          >
            {{item}}
          </KView>
        </KPickerViewColumn>
      </KPickerView>
    </div>
    <!-- vue-improve-loader -->
    <div check-reduce>
      <p>这段话不会在小程序里显示</p>
      <p>在构建的时候就会被 vue-improve-loader 给干掉了</p>
    </div>
    <!-- reduce-loader -->
    <Web>
      <p>这段话也不会在小程序里显示</p>
      <p>在构建的时候就会被 reduce-loader 给干掉了</p>
    </Web>
    <!-- 样式隐藏 -->
    <div class="for-web">
      <p>这段话也不会在小程序里显示</p>
      <p>在渲染时会被样式隐藏</p>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
import Vue from 'vue'
import Header from '../common/Header.vue'
import Footer from '../common/Footer.vue'
import Web from 'reduce-loader!../common/Web.vue'
import 'reduce-loader!./web'
import { KPickerView, KView, KPickerViewColumn } from 'kbone-ui'

export default Vue.extend({
  name: 'Home',
  components: {
    Header,
    KPickerView,
    KPickerViewColumn,
    Footer,
    Web,
  },
  data() {
    return {
      singleData: ['a', 'b', 'c', 'd']
    }
  },
  created() {
    window.addEventListener('wxload', query => console.log('page1 wxload', query))
    window.addEventListener('wxshow', () => console.log('page1 wxshow'))
    window.addEventListener('wxready', () => console.log('page1 wxready'))
    window.addEventListener('wxhide', () => console.log('page1 wxhide'))
    window.addEventListener('wxunload', () => console.log('page1 wxunload'))

    if (process.env.isMiniprogram) {
      console.log('I am in miniprogram')
    } else {
      console.log('I am in Web')
    }
  },
  methods: {
    changeIndex(e) {
      console.log('changeIndex', this.singleData[e])
    },
    onClickJump() {
      window.location.href = '/test/list/123'
    },

    onClickOpen() {
      window.open('/test/detail/123')
    },
  },
})
</script>

<style lang="less">
.cnt {
  margin-top: 20px;
}

a,
button {
  display: block;
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 20px;
  border: 1px solid #ddd;
}

.miniprogram-root {
  .for-web {
    display: none;
  }
}
</style>

KScrollView web页面滚动时持续报错

引入组件,设置scroll-y属性,拖动页面报如下错误:

组件版本: 0.6.8

TypeError: this._isScrollingOnBoundary is not a function
    at VueComponent.touchmove
    at invokeWithErrorHandling
    at HTMLDivElement.invoker
    at HTMLDivElement.original._wrapper

kbone-ui 引入报错。麻烦看下

kbone-ui 是真的用不了。 我升级了 vue-template-compiler, vue-loader 版本也不可以。
关键kbone-ui 没有这个方面的介绍呀。一用就遇到各种问题的了。https://www.npmjs.com/package/kbone-ui。

报错信息

ERROR in ./src/App.vue
Module Error (from ./node_modules/thread-loader/dist/cjs.js):


Vue packages version mismatch:

- [email protected] (D:\projectCompany\TLLB-applet\node_modules\vue\dist\vue.runtime.common.js)
- [email protected] (D:\projectCompany\TLLB-applet\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.