dattn / dnd-grid

A vuejs grid with draggable and resizable boxes
307 stars 48 forks source link

Workarounds for webpack import on vue-cli #24

Closed jennydaman closed 6 years ago

jennydaman commented 6 years ago

The code segment in README.md do not work for projects managed with vue-cli, which depends on webpack.

// import Container and Box components
import { Container, Box } from '@dattn/dnd-grid'
// minimal css for the components to work properly
import '@dattn/dnd-grid/dist/index.css'

Container and Box are undefined. I was able to work around this problem with the code below:

import dnd from "@dattn/dnd-grid";
import "@dattn/dnd-grid/dist/dnd-grid.css";

export default {
  name: "app",
  components: {
    DndGridContainer: dnd.Container,
    DndGridBox: dnd.Box
  }

Has anyone found a better way to do this?

dattn commented 6 years ago

This commit should fix you issue: https://github.com/dattn/dnd-grid/commit/7b9e32c9215bc183c4d9571de25900b82a7c9465 I will release a new version soon

dattn commented 6 years ago

Fixed in v0.0.13 release

jennydaman commented 6 years ago

Thank you!