1// Below is the HTML block2<template>3<div>4<div class="image" style={inlineStyle}>5<img src={salesforceUrl} />6</div>7</div>8</template>910// Below is the JavaScript block11import{LightningElement, api}from "lwc";12import SALESFORCE_LOGO from "@salesforce/contentAssetUrl/salesforce";1314export default class DemoSalesforceLogo extends LightningElement{15 @api width;16 @api height;1718 // Expose the static resource URL for use in the template19 get salesforceUrl(){20 return SALESFORCE_LOGO;21}2223 get inlineStyle(){24 return `width: ${this.width}px;height: ${this.height}px`;25}26}2728// Below is the Extensible Markup Language block29<?xml version="1.0" encoding="UTF-8" ?>30<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">31<apiVersion>54.0</apiVersion>32<isExposed>true</isExposed>33<targets>34<target>lightning__ServiceDocument</target>35</targets>36<targetConfigs>37<targetConfig targets="lightning__ServiceDocument">38<supportedFormFactors>39<supportedFormFactor type="Large" />40<supportedFormFactor type="Small" />41</supportedFormFactors>4243<property name="width" type="integer" />44<property name="height" type="integer" />45</targetConfig>46</targetConfigs>4748</LightningComponentBundle>
This code uses SFDX to deploy contentAssets.
1// Below is the XML block:2<?xml version="1.0" encoding="UTF-8" ?>3<ContentAsset xmlns="http://soap.sforce.com/2006/04/metadata">4<isVisibleByExternalUsers>true</isVisibleByExternalUsers>5<language>en_US</language>6<masterLabel>salesforce</masterLabel>7<relationships>8<organization>9<access>VIEWER</access>10</organization>11<workspace>12<access>INFERRED</access>13<isManagingWorkspace>true</isManagingWorkspace>14<name>sfdc_asset_company_assets</name>15</workspace>16</relationships>17<versions>18<version>19<number>1</number>20<pathOnClient>salesforce.png</pathOnClient>21</version>22</versions>23</ContentAsset>