Skip to content

Commit

Permalink
refactor(SvgEditor): use HeadContent render static assets (#182)
Browse files Browse the repository at this point in the history
* refactor: 更新静态文件渲染方式

* chore: bump version 9.0.1
  • Loading branch information
ArgoZhang authored Dec 16, 2024
1 parent 0067d14 commit 6573988
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.0.0</Version>
<Version>9.0.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@namespace BootstrapBlazor.Components
@using Microsoft.AspNetCore.Components.Web
@namespace BootstrapBlazor.Components
@inherits BootstrapModuleComponentBase
@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.SvgEditor/Components/SvgEditor/SvgEditor.razor.js", JSObjectReference = true)]

<HeadContent>
<link rel="stylesheet" href="./_content/BootstrapBlazor.SvgEditor/svgedit.bundle.css" />
</HeadContent>

<div class="bb-svg-editor svg-editor" id="@Id"></div>
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { addLink } from '../../../BootstrapBlazor/modules/utility.js'
import Data from '../../../BootstrapBlazor/modules/data.js'
import Data from '../../../BootstrapBlazor/modules/data.js'
import Editor from "../../editor/Editor.js"

export async function init(id, options) {
await addLink("./_content/BootstrapBlazor.SvgEditor/editor/svgedit.css")

export function init(id, options) {
const { preload, interop, callback } = options;

/* for available options see the file `docs/tutorials/ConfigOptions.md */
const svgEditor = new Editor(document.getElementById(id))
svgEditor.setConfig({
Expand All @@ -14,7 +12,7 @@ export async function init(id, options) {
allowInitialUserOverride: false,
imgPath: "./_content/BootstrapBlazor.SvgEditor/editor/images/",
showGrid: true,
extPath: "/_content/BootstrapBlazor.SvgEditor/editor/extensions/",
extPath: "./_content/BootstrapBlazor.SvgEditor/editor/extensions/",
noDefaultExtensions: false
})
svgEditor.init()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.svg-editor {
@import url('./editor/svgedit.css');

.svg-editor {
width: 100%;
height: 600px;
min-height: 600px
Expand Down

0 comments on commit 6573988

Please sign in to comment.