having a really strange issue where components that are imported into app.js, do not refresh/reload when changes are made to them, but changes made to app.js are reflected in the simulator and my phone.
So if I change something in the navigation component, nothing happens. If i change the ActionBar title, the change is reflected but the first change made in navigation is still not.
That only takes effect if I reload the whole project.
<template>
<Page>
<ActionBar title="Welcome to the Shop"/>
<GridLayout columns="*" rows="*">
<Label class="message" :text="msg" col="0" row="0"/>
<navigation></navigation>
</GridLayout>
</Page>
</template>
<script>
import navigation from '#/components/navigation/Master.vue';
export default {
components: {
'navigation': navigation
},
data() {
return {
msg: 'Hello World! This is Big D.'
}
}
}
</script>
Actually Webpack used to watch for those changes in Nativescript and it hasn't become matured in re rendering the native elements. I face this problem often too! And I observed that this used to happen for people whose tutorials i used to watch even.
And if u add or remove any files at ur applications, u need to delete the platform folder and run the tns run command.
But I would recommend u to use Sidekick as it used HMR, it works better than the normal tns cli. It's lot more comfortable to use. here's the link SideKick
Related
I have a problem in Visual Studio, more specifically with a react project. I don't get tooltips and autocomplete doesn't work, and autoimport doesn't work either. Also native functions of react are not displayed. For example, when you type useState, nothing is imported and no tooltips come out. What is the reason for this and how can it be corrected?
function App() {
return (
<div classname="App">
<Hell ??
</div>
);
}
export default App;
Component is not imported here
function App() {
return (
useStat ?!
<div classname="App">
<Hello/>
</div>
);
}
export default App;
Function hints not coming out
VS Code now handles this natively via a jsconfig.json and the JavaScript Language Service.
Create the file jsconfig.json at your project root and make sure to set checkJs to true:
Creating a JS Config file, allows Visual Studio to treat the folder as an Explicit Project. Without it, JS files opened in VS Code are treated as independent units, and there is no common project context between any two files.
Here you can find more info.
I am having a difficult time changing the background color of the page. I have attempted Tailwind a few times in the past, but always reverted back to Bootstrap as I know it pretty well.
This is a fresh Laravel 9 with Jetstream installation. It comes with Tailwind v3 ready to go.
On the body tag in the guest layout, I tried bg-red and bg-red-900 classes. It's still grey. Tailwind does at least work, because I added bg-red-900 to the login button itself, and the button turned red. It's just not liking it on the body tag.
In tailwind.config.js I added:
module.exports = {
theme: {
backgroundColor: '#000000',
}
};
I also tried:
module.exports = {
theme: {
extend: {
backgroundColor: '#000000',
}
}
};
I run npm run dev and caching is disabled per Chrome dev tools settings. I even tried a hard reload (right click reload button with dev tools open and choose "Empty cache and hard reload").
I am sure the css is being generated as I can see the tailwind comments in css/app.css. The page works, as it shows the normal breeze login page as it should. It just refuses to change the background color. I get if I am setting it wrong in the config, but for it to not accept bg-something as a class seems weird.
How do I change the background color? It will be the same background color for every page, so like a theme, but I don't want to declare a whole theme palette.
This is probably something simple because I know nothing about Tailwind. I've just searched and dug through the docs and just don't get it.
The background color in Jetstream in the guest layout is actually coming from the authentication-card component.
Once you have published the Jetstream components the authentication-card.blade.php component can be located at:
resources/views/vendor/jetstream/components/authentication-card.blade.php
You should see a bg-gray-100 class in the root div tag which is what you need to change.
I've had to take over a nativescript project from a former co-worker. We are trying to get the code updated to work properly on ios 13, but I can't figure out why previously working icons in a Button now just render as a '?'. Here is what the code looks like:
<FlexboxLayout class="toolbar">
<Button class="fa-light toolbar-button" (tap)="onNotesTap()" text="Hi"></Button>
<Button class="fa-light toolbar-button" (tap)="onAddTaskTap()" text=""></Button>
<Button class="fa-light toolbar-button" (tap)="onDirectionsTap()" text=""></Button>
<Button class="fa-light toolbar-button" [ngClass]="phoneCallEnabled ? '' : 'disabled'" (tap)="onPhoneTap()" text="" [isEnabled]="phoneCallEnabled"></Button>
</FlexboxLayout>
Does anyone have any recommendations or things that I can look at to figure out why this is no longer working? I updated tns-core-modules to the latest version, which fixed RadListView not rendering rows, but now I have this issue. Thanks!
UPDATE
So, it has SOMETHING to do with the app.css file not being read properly. I have looked all over the place and in the documentation, but I think that my app.css is set up properly. The reason I think this is that I copied the classes from the app.css to the css for the component, and it shows the images. Any ideas?
UPDATE2
Getting this error in my logs from tns-core-modules/trace/trace.js:174:0.
Error: Could not load CSS from app.css: TypeError: Expected module identifier to be a string.
Click any of the CodePen links on (for example) this page: https://vuetifyjs.com/en/components/navigation-drawers
Notice the flash of unstyled content. How do you eliminate this?
I see it in my project when I do a hard refresh. I tried v-cloak but of course that did not work.
You need to first hide the app
<div id="app" hidden>...</div>
Then use mounted.nextTick to unhide the app once it is ready
new Vue({
el:'#app',
mounted:function(){this.$nextTick(function(){
this.$el.removeAttribute('hidden')
})}
});
I am using the latest SyntaxHighlighter within my app and for some reason the toolbars do not show in IE, Firefox or Chrome. The code highlights without issue, but I want to have toolbars. What makes things worse is that the toolbar demo on the official website is not working either.
Am I missing something obvious? Below are the code nuggets.
<script src="Scripts/syntaxhighlighter/scripts/shBrushCSharp.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="Scripts/syntaxhighlighter/styles/shCoreDefault.css" />
<script type="text/javascript">
// Highlight code
SyntaxHighlighter.all();
</script>
<pre class="brush: csharp; ruler: true; title: 'Test'; toolbar: true;">
public static bool HelloWorld()
{
// Return
return false;
}
</pre>
I've been trying to figure this one out myself. I won't claim to be 100% correct here, but from what I can tell, this is the answer:
Toolbar was changed in update from version 2 to version 3.
Toolbar no longer includes the icons and whatnot.
The default toolbar is now the simple '?'.
This pretty much sucks, if it's true. The pop-up toolbar w/ icons is one of the things that made me choose SH over the other options.
This is what I'm guessing comparing the included CSS files in the latest package to the CSS available on sites that have a version with the "proper" toolbar enabled.
Here's a link to one I was snooping in: ramymostafa.com
While I would like the toolbar myself, it seems that one of the toolbars features - copy & paste - have been included without the need for a toolbar item:
If you double click anywhere on the code, the entire code view is replaces with a pre-selected view from which users can copy with a simple Ctrl/Cmd-C. Clicking anywhere else returns the view to the original state.
http://alexgorbatchev.com/SyntaxHighlighter/whatsnew.html#copytoclipboard
I would still like the pop out feature, but less buttons is a good thing, I guess?
the same problem here. looks like there is no toolbar in v3.
i use v2 again: http://alexgorbatchev.com/SyntaxHighlighter/download/download.php?sh_2.1.382
if you copy the css and js around, don't forget to include the images in folder styles
The toolbar can be easily be showing simply go to the plugin configuration, on the Highlighter Version set to VERSION 2X. This way the toolbar will be shown again!
I confirm that in Version 3 the toolbar does not show.