Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cimpress/vue-components

Package Overview
Dependencies
Maintainers
10
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cimpress/vue-components

[![npm version](https://img.shields.io/npm/v/@cimpress/vue-components.svg)](https://www.npmjs.com/package/@cimpress/vue-components)

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
10
Created
Source

Cimpress MCP Vue Components

npm version

A port of the Cimpress MCP React Components for VueJs

How to use

<template>
  <div>
    <text-field v-model="msg"/>  
  </div>
</template>
<script>
import { TextField }  from '@cimpress/vue-components`
export default {
  components: { TextField },
  data() {
    return {
      msg: 'Hello World'
    }
  }
}
</script>

Notes on compatibility

  • These components are a 1 on 1 port of the react components, that means you can use the documentation for those components.
  • You don't pass elements as an attribute but as a named slot item.
  • The onInput/onChange and value attributes have been replaced with v-model
  • All events (e.g. onInput and onChange) have been changed to vue events (e.g. @input and @change)

Full example

React
import React, { Component } from 'react';
import { Modal, TextField } from '@cimpress/react-components';

export default class ModalDemo extends Component {
  state = {
    modalIsOpen: false,
    msg: 'Hello World'
  };
  
  closeModal = () => {
    this.setState({ modalIsOpen: false });
  };

  openModal = e => {
    this.setState({ modalIsOpen: true });
  };
  
  onInputChange = e => {
    this.setState({ msg: e.target.value });
  };
  
  render() {
    return (
      <Modal
        show={this.state.modalIsOpen}
        onRequestHide={this.closeModal}
        title="An example modal"
        closeButton={true}
        footer={
          <button className="btn btn-default" onClick={this.closeModal}>
            Close
          </button>
        }>
        I am a modal body!
        <TextField
          name="bar"
          label="A Text Field"
          value={this.state.msg}
          onChange={this.onInputChange}
        />
      </Modal>
    )
  }
}
Vue
<template>
  <div>
    <modal
      :show="modalIsOpen"
      title="An example modal"
      :close-button="true"
      @request-hide="closeModal"      
    >
      <div v-slot:body>
        I am a modal body!
        <text-field 
          name="bar"
          label="A Text Field"
          v-model="msg"
        />
      </div>
      <div v-slot:footer>
        <button class="btn btn-default" @click="closeModal">Close</button>
      </div>
    </modal>  
  </div>
</template>
<script>
import { Modal, TextField }  from '@cimpress/vue-components';
export default {
  components: { Modal, TextField },
  data() {
    return {
      msg: 'Hello World',
      modalIsOpen: false
    };
  },
  methods: {
    closeModal() {
      this.modalIsOpen = false;
    },
    openModal() {
      this.modalIsOpen = true;
    }
  }
};
</script>

Porting Progress

  • CSS Loader
  • Accordion
  • Alert
  • Breadcrumbs
  • Button
  • Button Group
  • Card Header
  • Card
  • Carousel
  • Checkbox
  • Colors
  • Currency Selector
  • Documentation
  • Drawer
  • Dropdown
  • 404
  • Icon
  • IconStack
  • Label
  • Modal
  • NavTab
  • Notifications
  • Pagination
  • Phone
  • Progress Bar
  • Radio
  • Robot
  • Select
  • Select Wrapper
  • Slider
  • Snackbar
  • Spinner
  • Stepper
  • Table
  • Tag
  • Tab Card
  • Text Field
  • Toggle
  • Tooltip

FAQs

Package last updated on 18 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc