@pnp/generator-spfx
Version:
This Yeoman generator helps organisations to improve their development workflow with the SharePoint Framework. It extends the functionalities of the @microsoft/generator-sharepoint based on best pattern and practices. This generator extends the capabiliti
63 lines (53 loc) • 1.55 kB
text/typescript
import { Version } from '@microsoft/sp-core-library';
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
PropertyPaneTextField
} from '@microsoft/sp-webpart-base';
import { escape } from '@microsoft/sp-lodash-subset';
import * as strings from '<%= componentStrings %>';
// Importing Vue.js
import Vue from 'vue';
// Improting Vue.js SFC
import <%= componentName %>Component from './components/<%= componentName %>.vue';
export interface I<%= componentClassName %>Props {
description: string;
}
export default class <%= componentClassName %> extends BaseClientSideWebPart<I<%= componentClassName %>Props> {
public render(): void {
const id: string = `wp-${this.instanceId}`;
this.domElement.innerHTML = `<div id="${id}"></div>`;
let el = new Vue({
el: `#${id}`,
render: h => h(<%= componentName %>Component, {
props: {
description: this.properties.description
}
})
});
}
protected get dataVersion(): Version {
return Version.parse('1.0');
}
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
PropertyPaneTextField('description', {
label: strings.DescriptionFieldLabel
})
]
}
]
}
]
};
}
}