2.0.0-alpha.1 • Published 1 year ago

vue-milsymbol v2.0.0-alpha.1

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

vue-milsymbol

A Vue wrapper component for Milsymbol, for more information please visit milsymbol

⚠️ Attention: This is pre-release alpha version Vue wrapper component for milsymbol, there will be lots of changes coming soon.

Versions

Vuejs versionPackage versionBranch
3.x2.xmain (in development)
2.x1.xlegacy

Installation

To install vue-milsymbol you need to install this package via npm.

npm i vue-milsymbol

Quick start

import { createApp, h } from 'vue'
import VMilsymbol from 'vue-milsymbol'

const app = createApp({
  render: ...
})

app.use(VMilsymbol, {
  // Set default global options
  // See: https://www.spatialillusions.com/milsymbol/documentation.html
  size: 50
})

app.mount('#app')

In your component just declare v-milsymbol then add your options.

<template>
  <v-milsymbol
    ref="msymbol"
    :sidc="sidc"
    :options="{ size: 50 }"
  >
  </v-milsymbol>
</template>

<script>
export default {
  data: () => ({
    sidc: 'sfgpewrh--mt'
  }),
  mounted() {
    console.log(this.$refs.msymbol.getInstance())

    // To change symbol automatically you just
    // need to change the sidc and it'll change Immediately
    setTimeout(() => this.sidc = '10031000000000000000', 1000)
  }
}
</script>

Working with the package

npm run serve

Compile for production

npm run build