Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-713: Documentation clarification #115

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ static ResourceManagementOptionsConfiguration()
// This is resolved recursively so you don't need to add more than the direct child components.
.SetDependencies(DemoRepeater);

// We don't need to define an SFC resource for DemoRepeater since it doesn't have child components.
// We don't need to define an SFC resource for DemoRepeater, because it doesn't have child components. If you
// define an empty resource definition such as "_manifest.DefineSingleFileComponent(DemoRepeater);" it will be
// ignored.

// On the other hand make sure your .vue files are embedded during build, e.g. include this in the csproj:
// <ItemGroup><EmbeddedResource Include="Assets\Scripts\VueComponents\*.vue" /></ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions Lombiq.VueJs.Samples/Views/VueSfc/AppTagHelper.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
class="additional-class-for-styling"
model="@(new { Value = 10 })" />

@* If you are using Liquid, you can duplicate the above like this:
{% capture my_model %}{ value: 10 }{% endcapture %}
{% assign model_json = my_model | jsonparse %}

{% helper "vue-component-app", area:"Lombiq.VueJs.Samples", name:"demo-sfc", id:"unique-id", class:"additional-class-for-styling", model:model_json %}

Note the difference in the model, the Liquid version uses lower case "value". This is because the built-in JSON
serializer doesn't alter the names of JSON object properties the way it does with C# objects. *@

<button id="random" class="btn btn-primary" type="button">@T["Pick Random!"]</button>

<script at="Foot" depends-on="DemoSfcRootComponent-VueApp">
Expand Down