npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bo-components-p

v4.0.6

Published

規範 element-plus component 自訂的樣式及方法

Downloads

20

Readme

【 Step 1.確認依賴項目 】

  • 確認 package.json 中,是否已安裝以下套件,如沒有則需先安裝:
  • 以下依賴項目需連線到 npm config set registry https://registry.npmjs.org/ 才可安裝。
    "@element-plus/icons-vue": "^2.3.1",
    "@fortawesome/fontawesome-svg-core": "^6.5.1",
    "@fortawesome/free-brands-svg-icons": "^6.5.1",
    "@fortawesome/free-regular-svg-icons": "^6.5.1",
    "@fortawesome/free-solid-svg-icons": "^6.5.1",
    "@fortawesome/vue-fontawesome": "^3.0.5",
    "bootstrap": "^4.6.2",
    "element-plus": "^2.4.4"

【 Step 2.開始安裝 bo-components-p 】

  • 安裝 bo-components-p 套件:
    npm install bo-components-p

【 Step 3.套件引用 】

  • main.js 檔案中,全域引用 bo-components-p 套件:
    import { BOMethods, BOComponent } from 'bo-components-p'
    app.use(BOMethods)
    app.use(BOComponent)

【 Step 4.樣式引用 】

  • main.js 檔案中,全域引用 bootstrapelement-plusbo-components-p 的樣式,且引入層級順序必須如下:
    import '../node_modules/bootstrap/dist/css/bootstrap.css'
    import '../node_modules/element-plus/dist/index.css'
    import '../node_modules/bo-components-p/dist/style.css'

【 Step 5.各 methods 使用方法 】

  • .vue 檔案中使用方法如下:

    • 《 BOMessageBox | 泡泡視窗 》

      • title:呈現的標題,可任意填入字串
      • message:呈現的內文,可任意填入字串
      • type:呈現的狀態,共三種,分別為('success'、'warning'、'error'),皆須以字串方式
      • buttonText:呈現的按鈕文字,可任意填入字串
      this.$BOMessageBox('title', 'message', 'type', 'buttonText')
    • 《 BOLoading | 加載畫面 》

      this.$BOLoading() // 加載
      this.$BOLoading().close() // 加載結束

【 Step 6.各 component 使用方法 】

  • .vue 檔案中使用方法如下:

    • 《 Layout 樣式 A: 上方表頭 + 上方選單 》

      • BOTopHeaderprops 傳入設定:

        | props      | type   | required | default   |
        | :--------- | :----- | :------- | :-------- |
        | logoUrl    | String | true     | -         |
        | bgColor    | String | false    | #272C33   |
        | layoutType | String | false    | container |
      • BOTopMenuprops 傳入設定:

        | props           | type   | required | default   |
        | :-------------- | :----- | :------- | :-------- |
        | layoutType      | String | false    | container |
        | textColor       | String | false    | -         |
        | activeTextColor | String | false    | -         |
        | activeIndex     | String | false    | -         |
      • BOMenuItemprops 傳入設定:

        | props      | type   | required | default   |
        | :--------- | :----- | :------- | :-------- |
        | routeName  | String | true     | -         |
        | routeTitle | String | true     | menu item |
        | routeIndex | String | true     | -         |
        | textColor  | String | false    | #272C33   |
      • 檔案中使用範例:

        <template>
          <BOTopHeader logoUrl="yourImageUrlPath"></BOTopHeader>
          <BOTopMenu>
            <BOMenuItem routeName="yourRouterName" routeTitle="yourMenuTitle" routeIndex="yourMenuIndex"></BOMenuItem>
          </BOTopMenu>
        </template>
    • 《 Layout 樣式 B: 上方表頭 + 左側選單 》

      • BOLayoutHeaderprops 傳入設定:

        | props      | type   | required | default   |
        | :--------- | :----- | :------- | :-------- |
        | bgColor    | String | false    | #272C33   |
        | logoUrl    | String | true     | -         |
        | layoutType | String | false    | container |
      • BOLayoutMenuprops 傳入設定:

        | props        | type    | required | default      |
        | :----------- | :------ | :------- | :----------- |
        | bgColor      | String  | false    | #272C33      |
        | logoUrlSmall | String  | true     | -            |
        | logoUrlLarge | String  | true     | -            |
        | menuVisible  | Boolean | true     | -            |
        | userAccount  | String  | true     | user name    |
        | userId       | String  | true     | 0001         |
        | userIcon     | Object  | false    | faCircleUser |
      • BOMenuGroupprops 傳入設定:

        | props         | type   | required | default     |
        | :------------ | :----- | :------- | :---------- |
        | groupIndex    | String | true     | -           |
        | groupTitle    | String | false    | group item  |
        | groupItemIcon | Object | false    | faFileLines |
      • BOMenuItemprops 傳入設定:

        | props      | type   | required | default   |
        | :--------- | :----- | :------- | :-------- |
        | routeName  | String | true     | -         |
        | routeTitle | String | true     | menu item |
        | routeIndex | String | true     | -         |
        | textColor  | String | false    | #272C33   |
      • 檔案中使用範例:

        <template>
          <BOLayoutHeader logoUrl="yourImageUrlPath" @displayMenu="getDisplayMenuVal"></BOLayoutHeader>
        
          <BOLayoutMenu
            :menuVisible="menuVal" <!-- 綁定 data() 中的資料,建議不要更動 -->
            logoUrlSmall="yourImageUrlPath"
            logoUrlLarge="yourImageUrlPath"
            userAccount="yourUserAccount"
            userId="yourUserId" 
          >
        
            <BOMenuGroup groupTitle="yourGroupTitle" groupIndex="yourMenuIndex">
              <BOMenuItem textColor="yourColor" routeName="yourRouterName" routeTitle="yourMenuTitle" routeIndex="yourMenuIndexChildren"></BOMenuItem>
              <BOMenuItem textColor="yourColor" routeName="yourRouterName" routeTitle="yourMenuTitle" routeIndex="yourMenuIndexChildren"></BOMenuItem>
            </BOMenuGroup>
        
          </BOLayoutMenu>
        </template>
        
        <script>
          export default {
            data() {
              return {
                menuVal: true
              }
            },
            mounted () {
              window.addEventListener('resize', this.handleWindowResize)
            },
            methods: {
              getDisplayMenuVal() {
                this.menuVal = !this.menuVal
              },
              handleWindowResize () {
                if (window.innerWidth > 992) {
                  this.menuVal = true
                } else {
                  this.menuVal = false
                }
              }
            }
          }
        </script>
    • 《 Countdown | 倒數計時器 》

      • BOCountdownprops 傳入設定:

        | props          | type   | required | default |
        | :------------- | :----- | :------- | :------ |
        | hours          | Number | false    | -       |
        | minutes        | Number | false    | -       |
        | seconds        | Number | false    | -       |
        | actionDescribe | String | false    | ' '     |
      • BOCountdownemit 事件定義:

        | emits  | illustrate               |
        | :----- | :----------------------- |
        | timeUp | 當倒數計時結束時觸發此事件 |
      • 檔案中使用範例:

        <BOCountdown :hours="23" :minutes="60" :seconds="0" actionDescribe="後自動登出" @timeUp="handleTimeUp"></BOCountdown>