wijmo.vue2 Module

File
wijmo.vue2.js
Module
wijmo.vue2

Wijmo interop module for Vue 2.

This module provides Vue 2 components that encapsulate Wijmo controls.

To use it, your application must include references to the Vue 2 framework (RC6 or later), as well as the regular Wijmo CSS and js files.

To add Wijmo controls to Vue pages, include the appropriate tags in your HTML files. For example, the code below adds an InputNumber control to a Vue page:

<wj-input-number
  format="c2"
  placeholder="Sales"
  :value="sales"
  :value-changed="salesChanged"
  :min="0"
  :max="10000"
  :step="100"
  :is-required="false">
</wj-input-number>
// Wijmo event handler
// update "sales" value to match the InputNumber value 
function salesChanged(sender, eventArgs) {
  this.sales = sender.value;
}

The example illustrates the following important points:

  1. Wijmo controls have tag names that start with the "wj" prefix, followed by the control name using lower-case and hyphen separators.
  2. The tag attribute names match the control's properties and events.
  3. Colons before attribute names indicate the attribute value should be interpreted as JavaScript expressions (e.g. :min="0").
  4. Event handlers are specified the same way as regular properties (e.g. :value-changed="salesChanged").
  5. In Vue2, all bindings are one-way. In the example above, the "salesChanged" event handler is responsible for updating the value of the "sales" property in the model. This is a change from Vue 1, where two-way bindings could be created by adding the ".sync" suffix to any attribute.

All Wijmo Vue components include an "initialized" event that is raised after the control has been added to the page and initialized. You can use this event to perform additional initialization in addition to setting properties in markup. For example:

<wj-flex-grid :initialized="initGrid">
</wj-flex-grid>
// Vue application
var app = new Vue({
  el: '#app',
  methods: {
    initGrid: function(s, e) {

      // assign a custom MergeManager to the grid
      s.mergeManager = new CustomMergeManager(s);
    }
  }
});

Properties

Properties

WjAutoComplete

Vue component that encapsulates the AutoComplete control.

Type

WjBulletGraph

Vue component that encapsulates the BulletGraph control.

Type

WjCalendar

Vue component that encapsulates the Calendar control.

Type

WjColorPicker

Vue component that encapsulates the ColorPicker control.

Type

WjComboBox

Vue component that encapsulates the ComboBox control.

Type

WjFinancialChart

Vue component that encapsulates the FinancialChart control.

Type

WjFinancialChartSeries

Vue component that represents a FinancialSeries in a WjFinancialChart.

Type

WjFlexChart

Vue component that encapsulates the FlexChart control.

The example below shows how to instantiate and initialize a FlexChart control using Vue markup:

<wj-flex-chart
    :items-source="data"
    binding-x="country"
    :header="props.header"
    :footer="props.footer">

    <wj-flex-chart-legend :position="props.legendPosition">
    </wj-flex-chart-legend>
    <wj-flex-chart-axis wj-property="axisX" :title="props.titleX">
    </wj-flex-chart-axis>
    <wj-flex-chart-axis wj-property="axisY" :title="props.titleY">
    </wj-flex-chart-axis>

    <wj-flex-chart-series name="Sales" binding="sales">
    </wj-flex-chart-series>
    <wj-flex-chart-series name="Expenses" binding="expenses">
    </wj-flex-chart-series>
    <wj-flex-chart-series name="Downloads" binding="downloads">
    </wj-flex-chart-series>
</wj-flex-chart>

The code sets the itemsSource property to a collection that contains the chart data and the bindingX property to the data property that contains the chart X values. It also sets the chart's header and footer properties to define titles to show above and below the chart.

The wj-flex-chart-legend and wj-flex-chart-axis components are used to customize the chart's legend and axes.

Finally, three wj-flex-chart-series components are used to specify the data properties to be shown on the chart.

Type

WjFlexChartAxis

Vue component that represents a Axis in one of the following components: WjFlexChart , WjFlexChartSeries , WjFinancialChart or WjFinancialChartSeries.

Type

WjFlexChartDataLabel

Vue component that represents a DataLabel in a WjFlexChart.

Type

WjFlexChartDataPoint

Vue component that represents a DataPoint in one of the following components: WjFlexChartAnnotationText , WjFlexChartAnnotationEllipse , WjFlexChartAnnotationRectangle , WjFlexChartAnnotationLine , WjFlexChartAnnotationPolygon , WjFlexChartAnnotationCircle , WjFlexChartAnnotationSquare or WjFlexChartAnnotationImage.

Type

WjFlexChartLegend

Vue component that represents a Legend in one of the following components: WjFlexChart , WjFlexPie , WjFinancialChart , WjFlexRadar or WjSunburst.

Type

WjFlexChartLineMarker

Vue component that represents a LineMarker in one of the following components: WjFlexChart or WjFinancialChart.

Type

WjFlexChartPlotArea

Vue component that represents a PlotArea in one of the following components: WjFlexChart or WjFinancialChart.

Type

WjFlexChartSeries

Vue component that represents a Series in a WjFlexChart.

Type

WjFlexGrid

Vue component that encapsulates the FlexGrid control. The example below shows how to instantiate and initialize a FlexGrid control using Vue markup:

<wj-flex-grid
  :items-source="data">
  <wj-flex-grid-column binding="name" header="Name">
  </wj-flex-grid-column>
  <wj-flex-grid-column binding="sales" header="Sales" format="c0">
  </wj-flex-grid-column>
  <wj-flex-grid-column binding="expenses" header="Expenses" format="c0">
  </wj-flex-grid-column>
  <wj-flex-grid-column binding="active" header="Active">
  </wj-flex-grid-column>
  <wj-flex-grid-column binding="date" header="Date">
  </wj-flex-grid-column>
</wj-flex-grid>

The code sets the itemsSource property to a collection that contains the grid data, then specifies the columns to display using wj-flex-grid-column components.

Type

WjFlexGridColumn

Vue component that represents a Column in a WjFlexGrid.

Type

WjFlexGridDetail

Vue component that represents a FlexGridDetailProvider in a WjFlexGrid.

Type

WjFlexGridFilter

Vue component that represents a FlexGridFilter in a WjFlexGrid.

The example below shows how to instantiate and initialize a FlexGridFilter control with a filter using Vue markup:

<wj-flex-grid
  :items-source="data">
  <wj-flex-grid-filter></wj-flex-grid-filter>
</wj-flex-grid>
Type

WjFlexPie

Vue component that encapsulates the FlexPie control.

Type

WjFlexPieDataLabel

Vue component that represents a PieDataLabel in a WjFlexPie.

Type

WjFlexRadar

Vue component that encapsulates the FlexRadar control.

Type

WjFlexRadarAxis

Vue component that represents a FlexRadarAxis in one of the following components: WjFlexRadar or WjFlexRadarSeries.

Type

WjFlexRadarSeries

Vue component that represents a FlexRadarSeries in a WjFlexRadar.

Type

WjFlexSheet

Vue component that encapsulates the FlexSheet control.

Type

WjFormat

Vue filter that applies globalized formatting to dates and numbers.

For example, the code below uses the wj-format filter to format a number as a currency value and a date as a short date using the current Wijmo culture:

<p>value: {​{ theAmount | wj-format('c') }}</p>
<p>date: {​{ theDate | wj-format('d') }}</p>
Type

WjGroupPanel

Vue component that encapsulates the GroupPanel control.

The example below shows how to instantiate and connect a GroupPanel and a FlexGrid in Vue:

<wj-group-panel
  id="thePanel"
  placeholder="Drag columns here to create Groups">
</wj-group-panel>
<wj-flex-grid
  id="theGrid"
  :items-source="data">
</wj-flex-grid>
var app = new Vue({
  el: '#app',

  // connect group panel and grid
  mounted: function () {
    var panel = wijmo.Control.getControl(document.getElementById('thePanel'));
    var grid = wijmo.Control.getControl(document.getElementById('theGrid'));
    panel.grid = grid;
  }
});
Type

WjInclude

Vue component that includes a given HTML fragment into the document.

The wj-include component takes a src attribute that specifies a file to load and include into the document. For example:

<wj-popup control="modalDialog" :modal="true" :hide-trigger="None">
  <wj-include src="includes/dialog.htm"></wj-include>
</wj-popup>
Type

WjInputColor

Vue component that encapsulates the InputColor control.

Type

WjInputDate

Vue component that encapsulates the InputDate control.

Type

WjInputDateTime

Vue component that encapsulates the InputDateTime control.

Type

WjInputMask

Vue component that encapsulates the InputMask control.

Type

WjInputNumber

Vue component that encapsulates the InputNumber control.

Type

WjInputTime

Vue component that encapsulates the InputTime control.

Type

WjLinearGauge

Vue component that encapsulates the LinearGauge control.

The example below shows how to instantiate and initialize a LinearGauge control using Vue markup:

<wj-linear-gauge
    :min="0" :max="1000" :step="50" :is-read-only="false"
    format="c0" :thumb-size="20"
    :show-ranges="false"
    :value="sales"
    :value-changed="salesChanged">
    <wj-range wj-property="face" :thickness="0.5">
    </wj-range>
    <wj-range wj-property="pointer" :thickness="0.5">
    </wj-range>
    <wj-range :min="0" :max="333" color="red">
    </wj-range>
    <wj-range :min="333" :max="666" color="gold">
    </wj-range>
    <wj-range :min="666" :max="1000" color="green">
    </wj-range>
</wj-linear-gauge>

The code min, max, step, and isReadOnly properties to define the range of the gauge and to allow users to edit its value. Next, it binds the gauge's value property to a sales variable in the controller.

Then it sets the format, thumbSize, and showRanges properties to define the appearance of the gauge. Finally, the markup sets the thickness of the face and pointer ranges, and extra ranges that will control the color of the value range depending on the gauge's current value.

Type

WjListBox

Vue component that encapsulates the ListBox control.

Type

WjMenu

Vue component that encapsulates the Menu control.

Type

WjMultiAutoComplete

Vue component that encapsulates the MultiAutoComplete control.

Type

WjMultiRow

Vue component that encapsulates the MultiRow control.

Type

WjMultiSelect

Vue component that encapsulates the MultiSelect control.

Type

WjPdfViewer

Vue component that encapsulates the PdfViewer control.

Type

WjPivotChart

Vue component that encapsulates the PivotChart control.

Type

WjPivotGrid

Vue component that encapsulates the PivotGrid control.

Type

WjPivotPanel

Vue component that encapsulates the PivotPanel control.

Type

WjPopup

Vue component that encapsulates the Popup control.

Type

WjRadialGauge

Vue component that encapsulates the RadialGauge control.

The example below shows how to instantiate and initialize a RadialGauge control using Vue markup:

<wj-radial-gauge
    :min="0" :max="1000" :step="50" :is-read-only="false"
    format="c0" :thumb-size="12" :show-text="Value"
    :show-ranges="false"
    :value="sales"
    :value-changed="salesChanged">
    <wj-range wj-property="face" :thickness="0.5">
    </wj-range>
    <wj-range wj-property="pointer" :thickness="0.5">
    </wj-range>
    <wj-range :min="0" :max="333" color="red">
    </wj-range>
    <wj-range :min="333" :max="666" color="gold">
    </wj-range>
    <wj-range :min="666" :max="1000" color="green">
    </wj-range>
</wj-radial-gauge>

The code min, max, step, and isReadOnly properties to define the range of the gauge and to allow users to edit its value. Next, it binds the gauge's value property to a sales variable in the controller.

Then it sets the format, thumbSize, and showRanges properties to define the appearance of the gauge. Finally, the markup sets the thickness of the face and pointer ranges, and extra ranges that will control the color of the value range depending on the gauge's current value.

Type

WjRange

Vue component that represents a Range in one of the following components: WjLinearGauge , WjBulletGraph or WjRadialGauge.

Type

WjReportViewer

Vue component that encapsulates the ReportViewer control.

Type

WjSheet

Vue component that represents a Sheet in a WjFlexSheet.

Type

WjSunburst

Vue component that encapsulates the Sunburst control.

Type

WjTreeMap

Vue component that encapsulates the TreeMap control.

Type

WjTreeView

Vue component that encapsulates the TreeView control.

Type