Skip to content
Erik edited this page Sep 21, 2019 · 2 revisions

Vue-Salesforce Setup...

To setup your vue project to be working inside salesforce (as an iframe) start with plain vanila vue (or download this starter) and follow the steps below.

Build for Salesforce's Deployment

Download the repo and prepare the build for salesforce

create vue.config.js file

Add the section below with publicPath: '/'

module.exports = {
  publicPath: './'
};

Build the project

npm run build

go to DIST folder and create an archive (zip) file from the contents -> archive these files

Archive the contents of the dist folder

Prepare the Salesforce.

Create a new static resource

Go to salesforce, setup, type "static resources " in quick find. Create a new static resource with options as shown below and upload the contents of the archived build from the previous step. and click "save".

New Static Resource Creation

Create a new lightning web component using SF Developer Console where the vue app will reside

Open Salesforce Developer Console and create a new Lightning component as shown on the picture

SF Developer Console - Creating Web Component

Fill out the options as shown for the new component

Fill out the options as shown

Configure the vueApp.cmp file

Copy paste the below line as shown on the picture below to specify the static resource folder that was created before ("vue") and the entry point (the "/index.html").

<lightning:container src="{!$Resource.vue + '/index.html'}"/>

Lightning Component Configuration

Let's use the component

Let's say we decided to put the component on the "Home" page..

Goto "Edit page" as shown on the picture below

SF Edit Home Page

Find the newly created component on the left under "Custom" and drag it onto a section of the screen

You should be able to preview the component after that as shown below Drag and Drop the vue component

Save the changes and exit the edit mode

Click "Activate" to activate the changes and select the default visibility options when prompted as shown below. Then click "save"

Save and Activate the changes made

Accept the default options

That's it! You should be able to see the Vue starter page inside Salesforce

Vue Starter Page inside Salesforce