GithubHelp home page GithubHelp logo

vuejsvn / polaris-vue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ownego/polaris-vue

0.0 0.0 0.0 33.63 MB

Shopify Polaris design system for Vue JS. Shopify’s design system to help us build the great apps for all of our merchants.

Home Page: https://ownego.github.io/polaris-vue/

License: MIT License

JavaScript 1.48% TypeScript 15.11% HTML 0.22% Vue 83.15% SCSS 0.04%

polaris-vue's Introduction

Polaris Vue (Support Vue 3.0)

Polaris Vue by Ownego only supports Vue 3.0+.

Polaris Vue based on Shopify Polaris style guide, built especially for Vue 3. We're trying to make it mostly close with Shopify style guide and get a better performance.

Follow Polaris React version: 10.12.0 - Migrated date: Nov 23rd, 2022.


Documentation

Online documentation: Click Here


Installation

Via NPM:

npm install @ownego/polaris-vue

Via Yarn:

yarn add @ownego/polaris-vue

Usage

Use as a Vue 3 plugin (globally registers all components):

//main.js
import { createApp } from 'vue'
import PolarisVue from '@ownego/polaris-vue' // (✓)
import '@ownego/polaris-vue/dist/style.css' // (✓) This will be deprecated in the future, right after Vue 3 supports css injections.
import App from './App.vue'

//...
const app = createApp(App)
app.use(PolarisVue) // (✓)
...

OR use individual component:

import { List, Icon } from '@ownego/polaris-vue';

AppProvider

The AppProvider component is required to use PolarisVue. Without it, the components in your application will not function correctly. You must wrap the root (the top) of your application in the app provider component.

// App.vue
<template>
<AppProvider>
  ...
</AppProvider>
</template>

<script></script>

NUXT 3

We have tested support for Nuxt 3 in non-SSR mode only. To use with Nuxt 3, follow the below configuration and then use the plugin in your components/pages

Plugin File

Create a new plugin file at <project-root>/plugins/polaris.client.ts and update the content to following

import PolarisVue from "@ownego/polaris-vue";
import "@ownego/polaris-vue/dist/style.css";

export default defineNuxtPlugin(nuxtApp => {
  nuxtApp.vueApp.use(PolarisVue);
});

Nuxt Config

Update <project-root>/nuxt.config.ts to include following config values

export default defineNuxtConfig({
  ...
  build: {
    transpile: ["@ownego/polaris-vue"],
  },
  ...
});

De-duplicating Vue version

PolarisVue, other packages and your project may require access to the global Vue reference. So sometimes, you may get the runtime error message like:

TypeError: Cannot read properties of null (reading 'isCE')
renderSlot(...)
...

To avoid this, simply add dedupe: ['vue'] to your vite.config.ts file, like below:

export default defineConfig({
  resolve: {
    ...
    dedupe: ['vue'],
  },
  ...
});

Developers / Build

# Clone repo
git clone https://github.com/ownego/polaris-vue.git

# Install packages
yarn

# Create a Demo.vue file to test

# Development & Demo
yarn dev

Contributing

Polaris Vue by Ownego is an open source project and we are very happy to accept community contributions.

If you notice any bugs, please create issues under Issues. We will update the contribution rules later.

License

Code released under the MIT License. Copyright (c) 2021 Ownego

Thank you! 🎉

polaris-vue's People

Contributors

juzser avatar hqcuong avatar blacklen avatar vntrungld avatar chienit3bk avatar naveensky 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.