Giter Site home page Giter Site logo

semantic-ui-vue / semantic-ui-vue Goto Github PK

View Code? Open in Web Editor NEW
937.0 34.0 149.0 4.9 MB

Semantic UI integration for Vue

Home Page: https://semantic-ui-vue.github.io

License: MIT License

JavaScript 100.00%
vue vuejs2 vue2 semantic-ui components vue-components semantic-ui-vue

semantic-ui-vue's Introduction

Semantic UI Vue

Semantic UI Vue

Pipeline status NPM version codecov
Join the chat at https://gitter.im/Semantic-UI-Vue/Lobby

Looking for maintainers!

There is a lot to do and few maintainers with little time :). If you'd like to help with this project, please let us know.

Semantic UI Vue is the Vue integration for Semantic UI. It is highly inspired on Semantic UI React If you have used it already, you will find Semantic UI Vue's API to be almost the same. Semantic UI Vue is still under heavy development. Please, feel free to contribute. You can see the feature completion state here

Edit Simple semantic-ui-vue example

🚀 Installation

JavaScript

The Semantic UI Vue package can be installed via NPM/Yarn:

$ npm install semantic-ui-vue
# or
$ yarn add semantic-ui-vue

Installing Semantic UI Vue provides the JavaScript for your components. You'll also need to include a stylesheet to provide the styling for your components.

Once Semantic UI Vue has been installed, you will need to import it in your main file (usually index.js or main.js) and tell Vue to use it:

import Vue from 'vue';
import SuiVue from 'semantic-ui-vue';

/* ... */

Vue.use(SuiVue);

If you are not using Webpack, you can add the script in your html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- head -->
  </head>
  <body>
    <div id="app"></div>
    <script src="node_modules/vue/dist/vue.min.js"></script>
    <script src="node_modules/semantic-ui-vue/dist/umd/semantic-ui-vue.min.js"></script>
    <script>
      Vue.use(SemanticUIVue);
      var app = new Vue({
        el: '#app',
        data: {
          message: 'Hello Vue!',
        },
        template:
          '<span><sui-button primary>click me</sui-button>{{message}}</span>',
      });
    </script>
  </body>
</html>

Or, in alternative, you can import it using a CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.min.js"></script>
<script src="https://unpkg.com/semantic-ui-vue/dist/commonjs/semantic-ui-vue.js"></script>

Now you are ready to go! Check out the components' examples to see how to use them.

CSS

Content Delivery Network (CDN)

You can use the default Semantic UI stylesheet by including a Semantic UI CDN link in your index.html file. This is the quickest way to get started with Semantic UI Vue. You won't be able to use custom themes with this method.

To avoid unexpected behavior please use only the latest version of Semantic-UI

<link
  rel="stylesheet"
  href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
/>

Semantic UI CSS package

The Semantic UI CSS package is automatically synced with the main Semantic UI repository to provide a lightweight CSS only version of Semantic UI. Semantic UI CSS can be installed as a package in your project using NPM. You won't be able to use custom themes with this method.

$ npm install semantic-ui-css --save
# or
$ yarn add semantic-ui-css

After install, you'll need to include the minified CSS file in your index.js file:

import 'semantic-ui-css/semantic.min.css';

Semantic UI package

Install the full Semantic UI package. Semantic UI includes Gulp build tools so your project can preserve its own theme changes, allowing you to customize the style variables.

Detailed documentation on theming in Semantic UI is provided here.

$ npm install semantic-ui --save-dev
# or
$ yarn add semantic-ui

After building the project with Gulp, you'll need to include the minified CSS file in your index.js file:

import '../semantic/dist/semantic.min.css';

Nuxt.js module

You can use semantic-ui-vue as nuxt.js module.

Usage:

  • Install semantic-ui-vue and semantic-ui-css packages
  • Install semantic-ui-vue and semantic-ui-css packages
  • Add this into your nuxt.config.js file:
{
  modules: [
    'semantic-ui-vue/nuxt', // includes styles from semantic-ui-css
    ['semantic-ui-vue/nuxt', { css: false }], // if you have your own semantic-ui styles
  ];
}

🤝 Contact us!

Do you have a question? Do you want to submit a bug, or suggest an improvement?

Please contact us! Especially at this stage, we really need this.

To do so, do not hesitate to join our chat on Gitter, or submit an issue (it doesn't have to be a bug). Read the CONTRIBUTING.md for more details

Semantic UI Vue

📝 License

Copyright © 2019-present, Mario Lamacchia.
This project is MIT licensed.

semantic-ui-vue's People

Contributors

agneym avatar akmittal avatar amlang avatar dependabot[bot] avatar dkunin avatar dmitriytat avatar double-a-92 avatar edgarsn avatar exoego avatar gmessinese avatar granhal avatar hong-duc avatar jasontrue avatar longsightedfilms avatar lzfrnd avatar m3lith avatar mariolamacchia avatar mirik-k avatar nickrum avatar nmfzone avatar nywton avatar olitaylor avatar raynox avatar sinkersan avatar slide109 avatar supermdguy avatar symbx avatar todokr avatar viettrung9012 avatar whtht 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

semantic-ui-vue's Issues

Add examples for Dropdown

I'm not sure is it ready, but UMD version doen't work, so maybe example could show the way how to make it works.

Refuse nonsense component attribute combinations

Thanks for this awesome project!

This is not a priority, of course, but it would be pretty cool: Would it be viable to throw errors (or at least warnings) when components contain "conflicting" attributes? Super basic example: <sui-button primary secondary>Click me for nonsense</sui-button>

Thanks in advance!

All Modules are broken

See https://semantic-ui-vue.github.io/#/modules/accordion

I am getting the following error on page load:

vue.esm.js:566 TypeError: Cannot read property 'map' of undefined
    at VueComponent.render (Menu.jsx:42)
    at VueComponent.Vue._render (vue.esm.js:4128)
    at VueComponent.updateComponent (vue.esm.js:2538)
    at Watcher.get (vue.esm.js:2881)
    at new Watcher (vue.esm.js:2870)
    at mountComponent (vue.esm.js:2542)
    at VueComponent.Vue$3.$mount (vue.esm.js:7863)
    at VueComponent.Vue$3.$mount (vue.esm.js:10066)
    at init (vue.esm.js:3501)
    at createComponent (vue.esm.js:5147)

This occurs in all modules in the docs.

Using Chromium 60 on Linux

Modal dialog & other sizes (existing in official SUI CSS)

So, it turns out that the "tiny" size for the Modal component was left out of the prop validation, and possibly others (It looks like only fullscreen/small/medium/large are accounted for).

Is there any specific reason the other possible classes/settings for Modal size were omitted in the validation? I checked the vanilla SUI docs and they mention several others (mini/tiny are the ones that I see right offhand).

I'd like to see those accounted for in the validation (they work (as they do exist in SUI's CSS), but produce warnings/errors in console when used).

I added them and submitted a PR. First time doing that on GitHub, guess there's a first time for everything, huh?

#7

Lodash issues

Unable to resolve some modules:

"lodash/camelCase" in
/C/Users/ALERATOR/garlic/node_modules/sui-vue/dist/commonjs/lib/getChildProps.js
(web.browser)
"lodash/kebabCase" in
/C/Users/ALERATOR/garlic/node_modules/sui-vue/dist/commonjs/lib/getElementType.js
(web.browser)
"lodash/uniq" in
/C/Users/ALERATOR/garlic/node_modules/sui-vue/dist/commonjs/lib/PropTypes.js
(web.browser)

If you notice problems related to these missing modules, consider running:

meteor npm install --save lodash

Doesn't work with nuxt SSR

Working in nuxt, but without SSR, because in modules\Modal\animationHelper.js the window variable is using, which is undefined while SSR
image

How do I hook rating events?

Hello, thanks for making this. So far it has been quite helpful.

I am wondering how I can access @click events for the <sui-rating> component? That is, how can I use the clicked rating with axios or whatever?

Label with child elements

I have some Vue templates that I originally used with semantic UI without semantic-ui-vue. The checkbox labels originally had child elements, like so:

<label :for='candidate_source.id'>
  <i :class="candidate_source.brand.toLowerCase() + ' icon'"></i>{{ candidate_source.brand }} Exp: {{candidate_source.exp_month}}/{{candidate_source.exp_year}} {{ candidate_source.last4 }}
</label>

Unfortunately, the label property of the sui-checkbox component is treated as a string type. What's the recommended approach when properties might have child elements? I see the React wrapper for Vue has a notion of subcomponents that can be shortened into attributes when the content is just a string or simple scalar value, but I'm not sure i've spotted an example of that in this project.

I'd be happy to attempt implementing a patch to support this, but I'd like to make sure I understand how this project wants to handle this kind of case generally before trying my hand at that.

Interpret empty string as Boolean in props

I've noticed, that props, that are supposed to be true or some string value, doesn't work as true when specifying only the name of prop.

For example

This is not working:

<sui-table basic>...</sui-table>

You have to do it like this:

<sui-table :basic="true">...</sui-table>

I think it must work in first case also

Remove `hasClass` and `hasAttribute` in unit tests

When running unit tests there is a ton of these messages:

ERROR LOG: '[vue-test-utils]: hasClass() has been deprecated and will be removed in version 1.0.0. Use classes() instead—https://vue-test-utils.vuejs.org/en/api/wrapper/classes'
ERROR LOG: '[vue-test-utils]: hasAttribute() has been deprecated and will be removed in version 1.0.0. Use attributes() instead—https://vue-test-utils.vuejs.org/en/api/wrapper/attributes'

Is Semantic UI still under active development?

I'm looking for a css framework to use with vue. I really like the way semantic ui looks, but it seems like it is no longer under active development.

  1. What is the current situation with Semantic UI?

  2. And how will that affect this Vue js adaptation of it?

Maybe .vue one file components?

Hi. I love the idea to mix semantic ui and vue. I even wanted to start that on my own after using it extensively with jquery vetsion wrapping in my own library in one project.
What are reasons to use JSX? Why not vue single file components?
One of reasons I dont use React - its JSX and beauty of vue template-script-style combo in .vue files.

How to change default tag

I'm trying to change the default tag on a menu item from

to . I was able to find a reference to change the tag in getElementType.js but it appears there's a piece missing or that I am missing something.

This line:
const tag = instance.$vnode && instance.$vnode.data.tag;

I think should be like this:
const tag = instance.$vnode && instance.$vnode.data.attrs.tag;

Am I correct, or would you be able to tell me how?

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.