File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,11 +168,15 @@ const selectedPMAction = computed(() => currentPM.value.action)
168168const installCommand = computed (() => {
169169 if (! pkg .value ) return ' '
170170 const pm = currentPM .value
171+ let command = ` ${pm .label } ${pm .action } ${pkg .value .name } `
171172 // deno uses "add npm:package" format
172173 if (pm .id === ' deno' ) {
173- return ` ${pm .label } ${pm .action }${pkg .value .name } `
174+ command = ` ${pm .label } ${pm .action }${pkg .value .name } `
174175 }
175- return ` ${pm .label } ${pm .action } ${pkg .value .name } `
176+ if (requestedVersion .value ) {
177+ command += ` @${requestedVersion .value } `
178+ }
179+ return command
176180})
177181
178182// Copy install command
@@ -517,7 +521,10 @@ defineOgImageComponent('Package', {
517521 >  ; {{ pkg.name }}</span ><span
518522 v-else
519523 class =" text-fg-muted"
520- >{{ pkg.name }}</span ><template #fallback ><span class =" text-fg" >npm</span >  ; <span class =" text-fg-muted" >install {{ pkg.name }}</span ></template ></ClientOnly ></code >
524+ >{{ pkg.name }}</span ><span
525+ v-if =" requestedVersion"
526+ class =" text-fg-muted"
527+ >@{{ requestedVersion }}</span ><template #fallback ><span class =" text-fg" >npm</span >  ; <span class =" text-fg-muted" >install {{ pkg.name }}</span ></template ></ClientOnly ></code >
521528 </div >
522529 </div >
523530 <button
You can’t perform that action at this time.
0 commit comments