vue2-editor How to use vee-validate - vuejs2

<b-col><vue-editor name="content" v-model="formData.content" v-validate="required" :class="{'vue-editor': false, error:errors.has('content')}"/></b-col>
If you try to use it as above, it will not be used
Can I use vee-validate with vue2-editor ??

Yes you can use vee-validate with vue2-editor
but name="content" should be data-vv-name="content"

Related

Why doesn't the nested component render as a slottable custom element?

Are there limitations to compiling Svelte components as custom elements? For instance, are we able to nest components? And fill slots in those nested components?
I'm having trouble using a Svelte component as a custom element in my older Vue app.
I've got a Select and a Modal component in this simplified example: https://svelte.dev/repl/4d4ad853f8a14c6aa27f6baf33751eb8?version=3.6.4
I'm then compiling these with a standard-fare rollup.config.js:
export default {
input: "src/components.js",
output: [
// ...
{ file: "dist/index.min.js", format: "umd", name }
],
plugins: [
svelte({
dev: !production,
customElement: true,
// ...
}),
resolve(),
commonjs(),
!production && livereload("public"),
production && terser()
],
// ...
};
Then I go to use the custom elements. On click of the <conversational-select>, I get markup that looks like the following:
<conversational-select label="Domains" firstvaluelabel="All Domains">
<!-- shadow-root -->
<style>...</style>
<span class="select" >
<div class="select-value">Governance Board</div>
<div class="select-label" ></div>
</span>
<!-- The below div is the appropriate markup for Modal but the style isn't inlined and isn't slotted.
<!-- maybe because it didn't append as <sk-modal>? -->
<div ><slot></slot></div>
</conversational-select>
The "Modal" is sort-of rendering. But it doesn't fill the slot with span .chips. Doesn't inline the styles like the conversational-select does. Doesn't seem to attach its own event listeners. But does seem to create the fade transition thanks to Svelte's transition:fade directive.
I can reproduce this with a vanilla html file, so it's not Vue's fault.
Am I breaking some known rule with custom elements, butting up against the limitations of Svelte's custom element compilation, or just mistaken somewhere?
I was the author of the Svelte github issue that has been mentioned. I believe that I have a fix here. There were a few issues that existed:
slotted was never set
"nested" elements were not being added correctly
I expect the Svelte authors to make changes to my pull request, but if you want to use it, you can:
Clone my branch
Run npm && npm build && npm link
Go to your project and run npm link svelte

How to disable ion-button shadow in ionic 4?

I can't set the box-shadow property of ion-button to none in ionic 4, so how can I do that for a single button and for all the buttons at once ?
<ion-button class="main-button" >Get Started</ion-button>
.main-button{
--box-shadow:none;
}
CSS Custom Properties
--box-shadow
--background
--color
There is whole list of CSS Custom Properties in this link https://ionicframework.com/docs/api/button
I found a way that worked for me, the below code disables the ion-button shadow:
ion-button{
--box-shadow:none;
}

Vue-toastr and Vue2 how to set global options for toastr?

I'm using vue-toastr on my Laravel 5.5 and Vuejs 2 project.
The toasts are being showednormally, but I want to set some options globally for the toasts, like position...
I can't do this.
In my app.js file I've imported toastr from vue-toastr, required the styles and then Vue.component('vue-toastr', Toastr);.
I've tried this.$refs.toastr.defaultPosition = "toast-bottom-left" on my app.js like the docs say but it gives me an error Cannot read property 'toastr' of undefined
Any help?
As covered in the documentation:
Add component html: for vue 1.x
<vue-toastr v-ref:toastr></vue-toastr>
Add component html: for vue 2.x
<vue-toastr ref="toastr"></vue-toastr>
Then you can use
this.$refs.toastr.defaultPosition = "toast-bottom-left"

Inconsistent Asp.net MVC4 (Razor 2.0) Rendering if Write in html attribute

In cshtml view (Razor 2.0) I Have got code:
<input type="text" value="#if (true) { Write("simpletext"); } " />
In Result html generated by Razor 2.0 (MVC4) I have got:
<input type="text"simpletext value=" " />
In Razor 1.0 (MVC3) code is correct:
<input type="text" value="simpletext" />
It's seems like render processor wait quotation close, then add attribute to result stream.
How I can configure razor 2.0 to work as razor 1.0 in this case?
Thank you.
Try not using the Write function, but using the string directly in a ternary if
<input type="text" value="#(true ? "simpletext" : "")" />
Why dont you use HTML Helpers provided by Razor? I think this will help out by using HTML Helpers
#if (true) { #Html.Encode("SimpleText")}

Sharepoint - Using ScriptLink with js in Library

How can i include js which is in a sharepoint library. I tried that but without succes:
<SharePoint:ScriptLink ID="Formjs" runat="server" Localizable="false" Name="<% $SPUrl:~SiteCollection/My Library/myjs.js %>" />
Regards,
I just did this, I have my js in a doclib called "scripts", so its just
<script src="/scripts/myfile.js" language="javascript"></script>
That did it for me because I didn't need any of the advanced scriptlink options.