Giter Site home page Giter Site logo

udn-election2020-shared-lib's Introduction

udn-election2020-shared-lib

vue components shared library for election 2020 topics development

Usage

install

npm install @tenthree/udn-election2020-shared-lib

components

  • TheMenu
props: {
  // 專案ID
  projectId: { type: String, required: true },
  // 專案正式網址
  projectUrl: { type: String, required: true },
  // 顯示標題, 格式為 "看懂2020 - 專案名稱"
  title: { type: String, default: '' },
  // 更換漢堡按鈕顏色 (選填)
  hamburgerColor: { type: String },
  // 自訂分享網址 (選填)
  shareUrl: { type: String, default: '' },
  // 自訂分享文字 (選填)
  shareText: { type: String, default: '' }
}
  • TheUdnLogo
props: {
  // 連結網址
  link: { type: String, default: '.' },
  // 連結標題
  title: { type: String, default: '聯合報' },
  // 連結目標 (選填)
  target: { type: String, default: '_blank' },
  // 更換 Logo 顏色 (選填)
  color: { type: String, default: '#2E2E2E' }
}

example

  • main.js
import Vue from 'vue'

// import style
import '@tenthree/udn-election2020-shared-lib/dist/udn-election2020-shared-lib.min.css'

// import vue plugin
import Election2020 from '@tenthree/udn-election2020-shared-lib'

Vue.use(Election2020)

new Vue({
  render: h => h(App)
}).$mount('#app')
  • App.vue
<template>
  <div id="app" class="app">
    <!-- TheUdnLogo -->
    <TheUdnLogo
      link="https://udn.com/newmedia/election2020/youth"
      title="關鍵選民"
      target="_blank"
      color="#1a1a1a"/>

    <!-- TheMenu -->
    <TheMenu
      project-id="youth"
      project-url="https://udn.com/newmedia/election2020/youth"
      title="看懂2020 - 關鍵選民"
      hamburger-color="#1a1a1a"/>
  </div>
</template>

udn-election2020-shared-lib's People

Contributors

tenthree avatar

Watchers

 avatar

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.